Foros del Web » Creando para Internet » Flash y Actionscript »

Cambiar tamaño e imágenes cubo 3D AS3

Estas en el tema de Cambiar tamaño e imágenes cubo 3D AS3 en el foro de Flash y Actionscript en Foros del Web. Hola descargue este cubo en 3D y esta echo en AS3, quería saber como le puedo cambiar el tamaño(hacerlo mas chico) y las imágenes porque ...
  #1 (permalink)  
Antiguo 17/01/2013, 18:48
 
Fecha de Ingreso: febrero-2011
Mensajes: 138
Antigüedad: 13 años, 3 meses
Puntos: 6
Pregunta Cambiar tamaño e imágenes cubo 3D AS3

Hola descargue este cubo en 3D y esta echo en AS3, quería saber como le puedo cambiar el tamaño(hacerlo mas chico) y las imágenes porque solo tiene 1 imagen que se repite en los otros lados del cubo pero yo quisiera poder poner 1 imagen por cada lado espero y alguien me pueda ayudar dejo el el .fla para que lo chequen, gracias

http://www.mediafire.com/?g5jgql5czqa157x

dejo el código también

Código actionscript:
Ver original
  1. // fade in the entire stage
  2. stop();
  3. var cornerMask:Shape=new Shape();
  4. addChild(cornerMask);
  5. with (cornerMask.graphics) {
  6.     beginFill(0x0, 1);
  7.     drawRect(0,0,600,500);
  8.     endFill();
  9. }
  10. var enterFader:Function = function(event:Event):void {
  11.     if(cornerMask.alpha>0){
  12.         cornerMask.alpha-=.02;
  13.     }else{
  14.         // clean up memory
  15.         removeChild(cornerMask);
  16.         removeEventListener(Event.ENTER_FRAME,enterFader);
  17.         cornerMask=null;
  18.         enterFader=null;
  19.     }
  20. }
  21. addEventListener(Event.ENTER_FRAME, enterFader);
  22.  
  23.  
  24.  
  25. // simple positioning of the cubeMC holder and its 6 picture holding subMCs which make up all 6 sides  
  26. cube.z=600; // increase cube holder z to get enough space for its rotation
  27. // the picture's dimension is 360x360 dots and its registration point is centered
  28. cube.pix0.z=-180; // move the front 180 dots closer in the field of view (z)
  29. cube.pix1.x=180; // side to the right
  30. cube.pix1.rotationY=90;
  31. cube.pix2.x=-180; // side to the left
  32. cube.pix2.rotationY=-90;
  33. cube.pix3.z=180;  // backside
  34. //cube.pix3.rotationY=180;
  35. cube.pix4.y=-180; // top
  36. cube.pix4.rotationX=90;
  37. cube.pix5.y=180; // bottom
  38. cube.pix5.rotationX=-90;
  39.  
  40. // initiate variables
  41. var c:uint, transformedMatrix:Matrix3D, cubeSide:MovieClip, sortArray:Array = new Array();
  42. // prepare the array for the sortOn 'z', the object's fields in the array will store the particular movieClip plus its z position
  43. for(c = 0; c < cube.numChildren; c++){
  44.     sortArray[c]=new Object();
  45. }
  46.  
  47. // initiate speed variables for change of direction via mouse with acceleration
  48. var thrust:Number=.8,stepRemX:Number=0,stepX:Number,stepRemY:Number=0,stepY:Number, accelerate:Number=.08;
  49.  
  50. // render loop and function
  51. cube.addEventListener(Event.ENTER_FRAME, render);
  52. function render(event:Event):void {
  53.     // accelerate the rotation
  54.     stepX=(mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*-thrust; // will produce values ranging btw 0.8 to -0.8 depending on the mouse x position
  55.     if (stepRemX<stepX) {
  56.         stepRemX+=accelerate;
  57.     } else if (stepRemX>stepX) {
  58.         stepRemX-=accelerate;
  59.     }
  60.     stepY=(mouseY-stage.stageHeight/2)/(stage.stageHeight/2)*thrust;
  61.     if (stepRemY<stepY) {
  62.         stepRemY+=accelerate;
  63.     } else if (stepRemY>stepY) {
  64.         stepRemY-=accelerate;
  65.     }
  66.     // simply rotate the whole cube holder
  67.     cube.rotationX+=stepRemX;
  68.     cube.rotationY+=stepRemY;
  69.     for(c=0; c<6; c++){
  70.         // get a reference to all 6 cube sides
  71.         cubeSide = MovieClip(cube.getChildAt(c));
  72.         //This transformed matrix contains the actual transformed Z position.
  73.         transformedMatrix = cubeSide.transform.getRelativeMatrix3D(this);
  74.         //store this cubeSideMC and its 'z' position in the sortArray.
  75.         sortArray[c].MCobject=cubeSide;
  76.         sortArray[c].screenZ=transformedMatrix.position.z;
  77.     }
  78.     // sorting
  79.     sortArray.sortOn("screenZ", Array.NUMERIC | Array.DESCENDING);
  80.     for(c=0; c<6; c++){
  81.         // set the 3 sides in the back to visible = false and render the 3 in the front according to their Z Sorted value.
  82.         if(c<3){
  83.             sortArray[c].MCobject.visible=false;
  84.         }else{
  85.             cube.setChildIndex(sortArray[c].MCobject, c);
  86.             sortArray[c].MCobject.visible=true;
  87.         }
  88.     }
  89. }

Última edición por Jeshua_11_7; 18/01/2013 a las 09:55 Razón: Falto poner el codigo

Etiquetas: as3
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:10.