TUTORIAL 16:   This tutorial explains how To make the camera Follow a Bspline path Generated from a set of Contol points
             
 

 

----TUTORIAL 16---

Camera Bspline Path Following

 

You will Need The NemoX engine Get it Here

download the Visual Basic Source code here

 

Summary

 

1. Initializing Camera Bspline Path Follower Object

2. Updating camera position and Rotation

 

 

1. Initializing Camera Bspline Path Follower Object

Before using NemoX camera class, an object must be declared and allocated for it.
 

'New in NemoX 1.74
''========NEW OBJECT ONLY in NemoX version 1.074

Dim PATH As cNemo_PathFollower

'===================INITIALIZATION============'

'before using our Bspline Path follower class we have to add some Nodes control points

'allocate memory for path
      Set PATH = New cNemo_PathFollower
     
      'we will add some random Nodes control points to be followed
     
      For I = 1 To 100
        PATH.Add_Node Vector((Rnd - Rnd) * 2500, Rnd * 1500, (Rnd - Rnd) * 2500)
       
     
      Next I
     
      'important we init the bspline control points
      PATH.Init
      'we set the speed
      PATH.Set_Speed 15
     

 

2. Updating camera position and Rotation

 

'We must update calculations before retrieve any datas from our Bspline follower
 
     PATH.Update
    
    
    
    'We pass current path follower position
    KAMERA.Set_Position PATH.Get_Position
    
    
    KAMERA.Set_Rotation2 PATH.Get_RotationEx 'we pass Quaterion rotation
    
    'because we use random number
    'prevent some mathematical trouble
    On Error Resume Next
    KAMERA.Update  'important check previous tutorial
    

 

Here is a screenshot for our tutorial project

download the Visual Basic Source code here

See you in the next Tutorial.....sincerly Polaris..Don't forget Any Bugs detect

    The Next: Tutorial 17 :Using Billboard System

 The Previous: Tutorial 15 :Adding Free 6DOF camera

 

Tutorial Written on April, 28 th 2003 by Polaris: johna_pop@yahoo.fr