Racing Game Behind the Car View

Software: Away3D 4.x

emmie55, Newbie
Posted: 01 December 2013 06:31 PM   Total Posts: 10

hi guys, i noticed that on the demo showed here: the camera remains in the back of the car even if the car tries to rotate towards the camera (a view that does not allow us to view the front of the car). I want to achieve the same effect, but what works for me currently is only the view navigation using the mouse ( the mouseMove, mouseWheel etc functions) I am not sure which part of the source code provided is setting the default position of the camera (behind the car view) and its rotation to follow the car. Any ideas?


emmie55, Newbie
Posted: 04 December 2013 01:23 PM   Total Posts: 10   [ # 1 ]

the source code is here


John Brookes, Moderator
Posted: 04 December 2013 01:38 PM   Total Posts: 732   [ # 2 ]

Dont think the source is the same as the demo.

Just use the SpringController for the camera.


emmie55, Newbie
Posted: 06 December 2013 04:24 PM   Total Posts: 10   [ # 3 ]

Thanks for the reply! smile I just tried it and it seems to work but i cant seem to set the distance between the camera and the car when using the spring controller. Is there a way?


John Brookes, Moderator
Posted: 06 December 2013 04:31 PM   Total Posts: 732   [ # 4 ]


camController = new SpringController(camera, carBodyMesh);
camController.positionOffset = new Vector3D(0, 150, 500);
camController.mass = 60
camController.stiffness = 0.9
camController.damping = 16

Just play with the values.



Away3D Forum

Member Login