Camera car third person positioning

Software: Away3D 4.x

Avatar
Luca, Sr. Member
Posted: 06 February 2013 03:15 PM   Total Posts: 230

Hi guys, who of you know the way to solve this ?
CCar is the main bullet vehicle class that contains the definition of RayCastVehicle…

CCar.car.getRigidBody().worldTransform.rotation.y
returns 0 to 90 to 0 to -90 to 0 - if the car are rotating clockwise

so to make this:

  _view.camera.y = CCar.car.getRigidBody().worldTransform.position.y + 50;
  _view.camera.x = CCar.car.getRigidBody().worldTransform.position.x + -200 * ( Math.sin( CCar.carr ) );
  _view.camera.z = CCar.car.getRigidBody().worldTransform.position.z + -200 * ( Math.cos( CCar.carr ) );

i need to use this code for every frame:
  carr += car.getRigidBody().angularVelocity.y / 60;

none of this trig function can solve:
http://msdn.microsoft.com/en-us/library/w3t84e33(v=vs.71).aspx
or
http://en.wikipedia.org/wiki/Euler_angles
don’t tell me a solution. Do you know other ( more elegant ) way to solve this ?

   

Avatar
Luca, Sr. Member
Posted: 07 February 2013 04:43 PM   Total Posts: 230   [ # 1 ]

This can’t solve:

http://en.wikipedia.org/wiki/Rigid_body

   

Avatar
Luca, Sr. Member
Posted: 08 February 2013 04:49 PM   Total Posts: 230   [ # 2 ]

OK, the solution is simple:

  CamC = new SpringController( _view.camera, CCar.car.getRigidBody().skin, 0.01, 1, 1 );
  CamC.positionOffset = new Vector3D( 0, 50, -200 );

  CamC.autoUpdate = true;

The value of the controller must bu adjusted smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X