Thank's alot! I understand what you've did. Hope I can make it work soon! Thank's again for the help!<br><br><br><b><i>alexandra gavrilova <ain.interactive@gmail.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <div dir="ltr"><div>hi Alex,</div><div>hope this will help you, though my explanations are not <span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial; white-space: pre;">comprehensive ..</span></div> <div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre;">I describe the case with cylinder.</span></div><div><br> </div><div>suppose you have a class for plane (for example MyPlane).</div><div>so define public variables in it for angle </div><div><br></div><div>public class MyPlane</div><div>{</div><div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>public var angle:Number;</div>
<div> </div><div> public function MyPlane(angleParameter:Number)</div><div> {</div><div> angle = angleParameter;</div><div><br></div></div><div>}</div> <div><br></div><div>and pass angle (in degrees) which you use to calculate x and z coordinates of the plane as a parameter when creating the planes.</div><div>so, when you click a plane you can get this angle.</div><div><br> </div><div>also, you have to create a DisplayObject3d, which will be the target for orbiting the camera:<br></div><div>var targetPoint:DisplayObject3d = new DisplayObject3d();</div><div><br></div><div>and you need an object to tween angle for orbiting the camera (because Tweener can't tween just
variables):</div> <div>var myObject:Object = new Object();</div><div>myObject.yaw = 0;<br></div><div><br></div><div>i used interactiveSceneManager for listening clicks on planes:</div><div>viewport.interactiveSceneManager.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, onPlaneClick);</div> <div><br></div><div><div>function onPlaneClick(e:InteractiveScene3DEvent):void {</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>var newY:number = e.target.currentDisplayObject3D.parent.y;</div><div> <span class="Apple-tab-span" style="white-space: pre;"> </span>var newAngle:number = e.target.currentDisplayObject3D.parent.angle;</div><div> if(Math.abs(myObject.yaw - newAngle)>Math.PI){</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> if (newAngle < myObject.yaw) {</div> <div><span class="Apple-tab-span" style="white-space: pre;">
</span> myObject.yaw -= Math.PI * 2;</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> } else {</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span> myObject.yaw += Math.PI * 2; </div> <div><span class="Apple-tab-span" style="white-space: pre;"> </span> }</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>}</div><div> Tweener.addTween(myObject, { yaw:newYaw, time:2, onComplete:endOfMovement } );</div> <div> Tweener.addTween(targetPoint, { y:newY, time:2 } );</div><div> addEventListener(Event.ENTER_FRAME, onEnterFrame);</div><div>}</div><div><br></div><div>function endOfMovement():void{</div> <div>
removeEventListener(Event.ENTER_FRAME, onEnterFrame);</div><div>}</div></div><div><br></div><div><br></div><div><div>function onEnterFrame(e:Event):void {</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>camera.orbit(90, camProps.yaw, true, targetPoint); </div> <div><span class="Apple-tab-span" style="white-space: pre;"> </span>renderer.renderScene(scene, camera, viewport);</div><div>}</div><div><br></div><div>-</div><div>I didn't test this, but I hope it matters that you will understand the principles then simply use the code.</div> <div>if something isn't clear plese ask me, I'll try to explain.</div></div><div><br></div><div><br></div><div>ain</div><div><br></div> <div><br></div><div><br></div><div><br></div><div><br></div></div> _______________________________________________<br>Papervision3D mailing list<br>Papervision3D@osflash.org<br>http://osflash.org/mailman/listinfo/papervision3d_osflash.org<br></blockquote><br><p>