Node appears for an instant

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Gatekeeper
Posts: 31
Joined: Fri Apr 21, 2006 12:00 am
Location: Australia

Node appears for an instant

Post by Gatekeeper »

Hey,
I've got a little graphical glitch in my game, I'm not sure why or how. It's not making it unplayable, it's just annoying me.

Basically, I have a big scene node that is an arrow, and I hover this above players to show they are selected. When the game loads I load this arrow, set its visibility to false and set its position to (0,0,0).

When a person is selected I then (in this order) set the arrow node's parent to the person and set the visibility to true.

This causes the arrow node to briefly display (probably only 1 frame) at position (0,0,0), and after that it shows above the person as you would expect.

I guess I probably could set the arrow's initial position to somewhere off the screen, but that wouldn't really fix the underlying problem, and I'm afraid I'm going to encounter this problem the further I get into my 3d animations.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to call updateAbsolutePosition first to update the position before first render.
maverickbu
Posts: 17
Joined: Tue Dec 05, 2006 5:07 pm

Post by maverickbu »

Thanks for the tip hybrid, saved me a headache.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I hope you did not have headache all the time until now :lol:
Post Reply