This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?showtopic=264 as retrieved on 10 Aug 2007 05:04:21 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:DMk5GMx1V_wJ:www.flashsandy.org/forum/index.php%3Fshowtopic%3D264+site:www.flashsandy.org/forum&hl=en&ct=clnk&cd=106


Google is neither affiliated with the authors of this page nor responsible for its content.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> camera and bezier curve
Haron
post Jan 14 2007, 11:23 PM
Post #1


Newbie
*

Group: Members
Posts: 7
Joined: 24-December 06
From: Cadiz (Spain)
Member No.: 628



hi everybody.

I use a bezier path to perform a camera translation, like this:

var movement = new PathInterpolator(e.create(), 50, path); // path is the bezier curve
this.camera.setInterpolator(movement);

it's working. but I'm looking for a way to move the camera along the curve following its "velocity vector":

(IMG:http://serverstone.com/tmp/sample.gif)

the camera goes from the point A to the point B always looking ahead.

it is possible???

thanks a lot (and sorry for my English)

This post has been edited by Haron: Jan 14 2007, 11:31 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Petit
post Jan 15 2007, 12:30 AM
Post #2


Advanced Member
***

Group: Moderator
Posts: 587
Joined: 21-June 06
From: Borgholm, Sweden
Member No.: 38



QUOTE(Haron @ Jan 15 2007, 12:23 AM) *

I use a bezier path to perform a camera translation, like this:

the camera goes from the point A to the point B always looking ahead.
it is possible???

Have my first thought!

The Camera3D has the lookAt( x, y, z ), which would have to be called for each movement.
The camera moves one step per frame.
It would be possible to calculate the current position on the path.
Listening for the worlds onRenderEVENT, the event handler could calculate the tangent vector to the path at that point.
Then use the camera.lookAt() method to look at a point on that vector.

Seems like a lot to do. Hopefully there is a lazier method (IMG:style_emoticons/default/wink.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kiroukou
post Jan 15 2007, 10:37 AM
Post #3


Administrator
***

Group: Root Admin
Posts: 910
Joined: 12-June 06
Member No.: 1



Hi,
Yes there is a much simpler method (IMG:style_emoticons/default/wink.gif)
Since you are at a special position (which you can retrieve easily) and that you know your view vector direction, just create a point in front of you, let say :
lookAtPoint.x = CamPosition.x + ViewVector.x * aDistance;
lookAtPoint.y = CamPosition.y + ViewVector.y * aDistance;
lookAtPoint.z = CamPosition.z + ViewVector.z * aDistance;

The distance is whatever you want, but positive!

Each onRenderEvent set the lookAt vector to this point and that would be ok (IMG:style_emoticons/default/wink.gif)
++
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Haron
post Jan 15 2007, 06:32 PM
Post #4


Newbie
*

Group: Members
Posts: 7
Joined: 24-December 06
From: Cadiz (Spain)
Member No.: 628



thanks kiroukou and Petit. (IMG:style_emoticons/default/wink.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 10th August 2007 - 04:42 AM
phpMyVisites