christianclavet wrote:Not sure about this but you would have to implement it yourself.
- You will surely have to check how the code is made in that animator
- Find a way to generate a directional vector (Could take the last position with the new position of your mesh at each frame)
- Align your node to that directional vector. (If it's a camera then you use that directional vector add some distance to it then use it as your camera target. If it's a mesh, then you will have to take that vector, and get the angle from the direction vector. After that apply the angle to the mesh)
This require good knowledge of math's and C++. I'm good for figuring out how to do it, but giving you the code like that. I can't. I would have to check the source code and check how they do the 3 steps mentioned above. (Lots of IRRlicht functions source have most of the code for doing this. But you have to dig in and search, unless your very good in math and C++ as I mentioned above.)
rogerborg wrote:Quick trick, courtesy of JP: create an empty scene node, then either attach the same spline animator to it but start it off a little earlier, or create a new spline animator just for the look at position. Every frame, have your camera look at the empty scene node.
//added this 2 lines
const core::vector3df r = (p2 - p1).getHorizontalAngle();
Users browsing this forum: No registered users and 0 guests