-
Papervision3D
Hi everybody, I have some problems. I saw on one of the websites, a big invisible sphere, getting its vertices and placing small planes with movieclip material placed in DisplayObject3D. on enterframe DIsplayObject3D object containing planes in it is responding to mouse Xs and Ys. On click event using InteractiveScene3DEvent i am removing enterframe event of the DisplayObject3D. and bring up the clicked plane in front. Now i am using scale but then the material is distorted. I want to use Z axis but placing is not working perfectly. Here is my code if i am not clear in explaining my problem
private function services():void{
pivotDO3D = new DisplayObject3D;
scene.addChild(pivotDO3D);
sphere1 = new Sphere(null, 150, 4, 5);
var numberOfVertices:uint = sphere1.geometry.vertices.length;
var btnsArray:Array = new Array(teethBtn_mc, veneersBtn_mc, lumineersBtn_mc, rootBtn_mc, orthoBtn_mc, restoreBtn_mc, implantsBtn_mc, gumBtn_mc, planBtn_mc, advanceBtn_mc, oralBtn_mc, extractBtn_mc, crownBtn_mc, denturesBtn_mc, surgeryBtn_mc, disableBtn_mc, preventBtn_mc, emptyBtn_mc);
for(var i:uint=0; i<numberOfVertices; i++)
{
var material:MovieMaterial = new MovieMaterial(btnsArray[i], true, true);
material.doubleSided = true;
material.smooth = true;
material.precise = true;
material.interactive = true;
plane = new Plane(material, 45, 45);
plane.x = sphere1.geometry.vertices[i].x;
plane.y = sphere1.geometry.vertices[i].y;
plane.z = sphere1.geometry.vertices[i].z;
plane.addEventListener(InteractiveScene3DEvent.OBJ ECT_PRESS, openService, false, 0, true);
pivotDO3D.addChild(plane);
addEventListener(Event.ENTER_FRAME, loopServices);
}
}
private function openService(e:InteractiveScene3DEvent):void{
removeEventListener(Event.ENTER_FRAME, loopServices);
var rotatex:Number = -(e.target.parent.rotationX);
var rotatey:Number = -(e.target.parent.rotationY);
var rotatez:Number = -(e.target.parent.rotationZ);
TweenLite.to(e.target, 2, {x:0, y:0, z:0, scaleX:10, scaleY:10, rotationX:rotatex, rotationY:rotatey, rotationZ:rotatez, ease:Expo.easeOut});
}
private function loopServices(e:Event):void{
pivotDO3D.localRotationY += ((-stage.mouseX + stage.stageWidth / 2) / 2) / 50;
pivotDO3D.localRotationX += ((-stage.mouseY + stage.stageHeight / 2) / 2) / 50;
}
please help me fellows. Thanks
-
I solved some of the issues. But right now there is just one problem and that is to bring up a single plane with straight alignment means no rotation in X, Y and Z. As itself inside the DisplayObject3D is at 0 in all rotation. but since i am moving DisplayObject3D i want to bring up the plane and straighten up. Still i can get some help. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|