CuteAlien wrote:You might want to search the forum, I think I've seen a post about that before somewhere (but yeah, could be a little hard to find). When I coded that I created an own scenenode for it and did the scaling and finding the view direction in OnRegisterSceneNode. Also didn't use it as child of the camera - first I had more than one camera anyway and I generally find the math just easier when both nodes just use absolute positions.
Scaling was something like distance of that node to the camera divided by the camera far value (was not 100% correct I think, but close enough you didn't notice usually).
Thanks for the reply, I've searched, found some topics nearly identical, but none offers a solution, one of them, the OP just figure it out and leaves the topic unanswered.
Anyway, looks like the children nodes doesn't follow the parents orientation and position as I've firstly imagined. I've discovered that SceneNodes work with a internal matrix called AbsoluteTransformation, I'm using it in a Animator on the ArrowSceneNode:
Code: Select all
void animateNode(scene::ISceneNode* node, u32 timeMs) {
core::vector3df mod(-5,5,10);
node->getSceneManager()->getActiveCamera()->getAbsoluteTransformation().transformVect(mod);
node->setPosition(mod);
}
It now stays stationary to the view, its almost ok.
But how could I make it render these arrows in orthogonal projection?
and my great doubt, should a create a ISceneNode, IMesh or stay with ISceneNodeAnimator subclass for this?
(I think I can make it work on every class, which will bring more benefits in this case)
Another problem is when I strafe to the sides with the camera, the arrow mesh start to shake, as it is taking a micro delay to keep the pace with the camera.
Moving forward/Backward or rotating the camera is ok, not delays.
What could it be ? Is the animateNode method called every frame for sure ? or maybe its the precision of the matrix calculations?
Sorry about the english and the number of questions
, but I really want to understand this engine, I dropped python and started to learn C++, and I found the Irrlicht engine the only which is good enough for games and free for commercial purposes.