<div><font face="courier new,monospace">i think you can achieve this w/ interactiveScene3DEvents.</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">when you click on a plane, you have a function that gets called.</font></div>
<div><font face="courier new,monospace">that function takes a parameter of the InteractiveScene3DEvent type. </font><font face="courier new,monospace">lets call it "e".</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">from "e" you can get all kinds of info about the object your</font></div>
<div><font face="courier new,monospace">interacting w/ (eg, x/y/z position, rotation, name, material, etc, etc, etc)</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">i think it would be easy to use the X/Y/Z pos of the plane clicked as a </font><font face="courier new,monospace">target for your camera. just decrease the Z value so the camera will not </font><font face="courier new,monospace">fly thought the target plane. </font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">this code is untested!</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">[code]</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">function constructor() {</font></div>
<div><font face="courier new,monospace"> var thePlane = new Plane(...);</font></div>
<div><font face="courier new,monospace"> thePlane.addEventListener(InteractiveScene3DEvent.CLICK, onClick);</font></div>
<div><font face="courier new,monospace"> scene.addChild(thePlane);</font></div>
<div><font face="courier new,monospace">}</font></div>
<div><font face="courier new,monospace">function onClick(e:InteractiveScene3DEvent):void {</font></div>
<div><font face="courier new,monospace"> //create a temp object<br> var target:DisplayObject3D = new DisplayObject3D();</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace"> //set is positions equal to the clicked object's</font></div>
<div><font face="courier new,monospace"> target.x = e.displayObject3D.x;<br> target.y = e.displayObject3D.y;</font></div>
<div>
<div><font face="courier new,monospace"> //offset the z depth</font></div><font face="courier new,monospace"> target.z = e.displayObject3D.z - 300;</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace"> //you can manually move camera position with: </font></div>
<div><font face="courier new,monospace"> //cam.copyPosition(target); </font></div>
<div><font face="Courier New"></font> </div>
<div><font face="courier new,monospace"> //but honestly, this would look better w/ a tween</font></div>
<div><font face="courier new,monospace"> Tweener.addTween(cam, {</font></div>
<div><font face="courier new,monospace"> x: target.x, </font></div>
<div><font face="courier new,monospace"> y:target.y, </font></div>
<div><font face="courier new,monospace"> z:target.z, </font></div>
<div><font face="courier new,monospace"> time: 10, </font></div>
<div><font face="courier new,monospace"> transision: easeOutSine</font></div>
<div><font face="courier new,monospace"> });</font></div>
<div><font face="courier new,monospace">}</font></div>
<div><font face="courier new,monospace">[code]</font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">like i said, this code is untested (wrote in gmail).</font></div>
<div><font face="courier new,monospace">but the core concept is there. </font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">hope that helps!<br clear="all">____ ___<br>\ \/ /___________ ____<br>.\ // __ \_ __ \/ _ \<br>./ \ ___/ | | \( <_> )<br>/___/\ \___ >__|---\____/<br>| \_/ \/ |<br>
| xero harrison |<br>| <a href="http://xero.nu">xero.nu</a>@<a href="http://gmail.com">gmail.com</a> |<br>| <a href="http://xero.nu">http://xero.nu</a> |<br>| <a href="http://fontvir.us">http://fontvir.us</a> |<br>
| <a href="http://hexarray.nu">http://hexarray.nu</a> | <br>| <a href="http://xero.owns.us">http://xero.owns.us</a> |<br>`---------------------' <br></font><br></div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">---------- Forwarded message ----------<br>From: montey <<a href="mailto:e_account@mac.com">e_account@mac.com</a>><br>
To: <a href="mailto:papervision3D@osflash.org">papervision3D@osflash.org</a><br>Date: Tue, 23 Jun 2009 08:41:52 -0700 (PDT)<br>Subject: Re: [Papervision3D] Animating camera to target<br><br>The code you suggested doesn't seem to give the effect I'm looking for. Maybe<br>
I can try and explain this a little better.<br>I have 20 planes all moving back in z depth. All I want to do is move my<br>camera through them as I click on the next plane. So if I click on plane 2<br>the camera will fly through plane 1 and show plane 2 and as I click on the<br>
next it flys through the next plane.<br><br><br><br>gordee wrote:<br>><br>><br>> If I have understood what you are trying to do, then try this;<br>> interactiveScene3DEvent.target is the plane clicked on;<br>><br>
> var xpos:Number = iS3DEvent.target.x - iS3DEvent.target.width/2;var<br>> ypos:Number = iScene3DEvent.target.y - iS3DEvent.target.height/2;<br>> zpos:Number = iScene3DEvent.target.z - 100;<br>><br>> Tweener.addTween(camera, {x:xpos, y:ypos, :z:zpos, time:1});<br>
> hth<br>><br>> Regards<br>> Gordon Everett<br>><br>> My preferred email address: <a href="mailto:gordon.everett2@gmail.com">gordon.everett2@gmail.com</a><br>><br>> My Blog: <a href="http://flashgordonmedia.blogspot.com/" target="_blank">http://flashgordonmedia.blogspot.com/</a><br>
><br>><br>><br>><br>><br>><br>><br>><br>><br>>> Date: Mon, 22 Jun 2009 22:18:15 -0700<br>>> From: <a href="mailto:e_account@mac.com">e_account@mac.com</a><br>>> To: <a href="mailto:papervision3D@osflash.org">papervision3D@osflash.org</a><br>
>> Subject: [Papervision3D] Animating camera to target<br>>><br>>><br>>> I have 20 planes positioned with z spacing what I'm trying to do is move<br>>> the<br>>> camera through all my planes as the user clicks on each plane. I'm trying<br>
>> to<br>>> figure out how to do that. I tried setting the camera target to the<br>>> clicked<br>>> plane but that didn't work. I just want to tween the camera through each<br>>> plane like a fly through.<br>
>><br>>> Any ideas please.<br>>> --<br>>> View this message in context:<br>>> <a href="http://www.nabble.com/Animating-camera-to-target-tp24158838p24158838.html" target="_blank">http://www.nabble.com/Animating-camera-to-target-tp24158838p24158838.html</a><br>
>> Sent from the Papervision3D mailing list archive at Nabble.com.<br>>><br>>><br>>> _______________________________________________<br>>> Papervision3D mailing list<br>>> <a href="mailto:Papervision3D@osflash.org">Papervision3D@osflash.org</a><br>
>> <a href="http://osflash.org/mailman/listinfo/papervision3d_osflash.org" target="_blank">http://osflash.org/mailman/listinfo/papervision3d_osflash.org</a><br>><br>> _________________________________________________________________<br>
> Get the best of MSN on your mobile<br>> <a href="http://clk.atdmt.com/UKM/go/147991039/direct/01/" target="_blank">http://clk.atdmt.com/UKM/go/147991039/direct/01/</a><br>> _______________________________________________<br>
> Papervision3D mailing list<br>> <a href="mailto:Papervision3D@osflash.org">Papervision3D@osflash.org</a><br>> <a href="http://osflash.org/mailman/listinfo/papervision3d_osflash.org" target="_blank">http://osflash.org/mailman/listinfo/papervision3d_osflash.org</a><br>
><br>><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Animating-camera-to-target-tp24158838p24167340.html" target="_blank">http://www.nabble.com/Animating-camera-to-target-tp24158838p24167340.html</a><br>
Sent from the Papervision3D mailing list archive at Nabble.com.<br><br><br><br></blockquote></div>