Reputation: 4817
I am following the tQuery plugins examples and spend some time playing with the rollercoster example. There i tweak some of the code and did manage to add a custom animating object to the scene. Here the camera follows the points in a spline closed path and i hooked the animating object with the camera so that the object also moves with the camera. What i was hoping to achieve is to face the object towards the scene and move it along the camera which gives nice effect as if the object is moving or racing along the path. The object follows the path but it also changes its rotation with the camera as the camera progress. which gives the effect as if the object is falling through the path. What i am trying to say is this:
http://strongcodelabs.com/bird_stackoverflow/index-tube.html
Here you can see what i have done so far.
and here is the code for that:
https://github.com/kshitizrimal/demo_predator/blob/master/examples/index-tube.html
What i would like to achieve is the object always have same oreintation as it follows the path.
like this:
The object should always have this orientation.
Upvotes: 0
Views: 829
Reputation: 7761
You have line camera.lookAt(point);
, and that exact same instruction could be used for the bird to direction it.
bird.lookAt(point);
Hope this helps.
Upvotes: 1