# Camera Path

This topic is 4596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, How would you create a predefined path for the camera to move on? That may have sounded dumb the way I put it, but I have no idea of any methods used for this. Thanks alot. Levi

##### Share on other sites
You could use splines. They're basically curves that are fit to a series of waypoints. The curviness can be manipulated in different ways. Here's a fun little page that gives a nice overview:

http://www.cse.unsw.edu.au/~lambert/splines/

-me

##### Share on other sites
So you would calculate the points on the spline, then have the camera move through them? Is that correct?
Thanks
Levi

##### Share on other sites
Quote:
 Original post by levjsSo you would calculate the points on the spline, then have the camera move through them? Is that correct?
There are lots of different ways to do it. For example, you often want to use arc length reparameterization so you can control the speed of the camera more carefully. There are also various issues to consider related to orienting your camera as it moves along the curve.

As far as your curve goes, the most basic requirement is to be able to evaluate the position at a given parametric value t. With that, you could do a very simple 'camera follows curve' implementation using gluLookAt() or its equivalent, using the position corresponding to t and the position corresponding to t+h, where h is the step.

##### Share on other sites
Hi,
Thanks for the responses. I know now what I must do, I now need a push(or maybe a big shove) in the right direction. [smile] Are there any tutorials out there on this(I've looked without much success). How I understand it, I mush create a spline, and move the camera along it. What are some equations for creating splines like that? Also, of the spines mentioned in the above link, which would better suit my purpose. Thanks so much.
Levi

[Edited by - levjs on April 18, 2006 11:44:13 AM]

##### Share on other sites
http://ibiblio.org/e-notes/Splines/Intro.htm This site has quite alot of useful info ;)

Good luck :)

##### Share on other sites
Which of those splines should I use to control the camera? I really have no idea what I'm doing here. [smile]
Levi

##### Share on other sites
Depends on the what kinda movement you want.. You're just moving your camera along the path.. The splines just gives it nice coords for its travels ;)

##### Share on other sites
That's what I figured.

I'll see if I can do it now. *skepticly rolls eyes* [smile]

##### Share on other sites
Rating++ for the helpers. [smile]

Wow, I've done it. With you and the help of some other code in which it was demonstrated, I took it apart, understood it, and wrote my own program. I must say, it wasn't as complicated as I thought it would be.

Can someone explain what tangents and normals to the curve would be useful for....

Now, I know this has no relation to any of it, but can any of you point me to a place that could explain matrix math. Is matrix math supposed to be taught in algebra 1 or 2, or what?, because I didn't get it in Alg1,Alg2, or Geometry. Or is it a more specialized math that you have to pick up yourself?
Thanks so much.
Levi

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633407
• Total Posts
3011699
• ### Who's Online (See full list)

There are no registered users currently online

×