Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Camera spline  (Read 347 times)
Canning
Community Member
*
Posts: 592


« on: November 07, 2011, 05:27:19 PM »

I am wanting to move a camera smoothly from one vector to another at various stages in my game. Am I correct the best way to this is to create a TVPath object, add the two vector positions and then move the camera via the Path.CameraSpline method.

I have created the path, added the two vectors, but am lost on how to implement it via the Path.CameraSpline method.

The documentation is here: http://wiki.truevision3d.com/tvpath/cameraspline

I am confused as to what the fPathNode As Single , fDelta As Single arguments are.

Can some knowledgeable person explain them to me?  Smiley

thanks

Canning
Logged

I am using 2010 VB.NET and TV 6.5 with Windows 7
Dimple
Community Member
*
Posts: 580


« Reply #1 on: November 07, 2011, 07:25:28 PM »

 Smiley

TVPath.CameraSpline( fTime As Single, Delta As Single)
 

Moves the camera along the spline. Very good for demo or non-interactive scenes.


Arguments :
fTime  Time on the spline (in node), can be between 1 and TVPath.getNodeCount()
Delta  Delta is the difference of path time between camera position and camera lookat (see remark)


Remark:
The camera spline functions actually uses twice the GetSplinePoint functions, to return :
. The camera position (GetSplinePoint(fTime))
. The camera lookat point (GetSplinePoint(fTime + Delta))


This is a TV6.3 example

Code Sample :
//Add 3 nodes to 3 diffrent positions.
TVPath.AddPathNode(Vector3(14,2,42))
TVPath.AddPathNode(Vector3(35,124,64))
TVPath.AddPathNode(Vector3(32,34,12))
// typical game loop for demo
Do
Doevents
TV.Clear
RenderAll()
TV.RenderToScreen
Time = Time + TV.AccurateTimeElapsed * 0.002
TVpath.CameraSpline Time, 1
Loop
 
Also read this thread it talks about some changes in TV65.
http://www.truevision3d.com/forums/tv3d_sdk_65/camera_path_command-t10130.0.html;msg70999#msg70999
« Last Edit: November 07, 2011, 07:32:54 PM by Dimple » Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
Canning
Community Member
*
Posts: 592


« Reply #2 on: November 08, 2011, 05:20:35 AM »

OK, thanks.

I am wondering if this spline movement is the best for me.

Here is my situation:

I have a 3d space ship model with a camera following it. The camera only updates when I thrust forward. So I can turn my ship without affecting the camera, but when i move forward, I want the camera to move slowly to the new position.
The camera lookat keeps looking at the ship.

Would it be better to do some normalizing of the two camera positions and then slowly move the camera from the current position to the new one, or play around with the CameraSpline function?

Canning
 
Logged

I am using 2010 VB.NET and TV 6.5 with Windows 7
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks