[SOLVED] Making objects dis/reappear on certain conditions
Posted: Tue Apr 18, 2006 12:14 pm
Hey guys! Sorry if this has been asked in the forums before, cos I did a search and nothing that came up could help me.
I was wondering how do I make models disappear and reappear on certain conditions. For example:
When the player reaches a certain point on the map, a 3D arrow appears in front of the player.
What I had in mind is:
- initially set 3D arrow visibility to false OR scale it to 0
- always get camera position
- set Z coordinate to trigger (just took Z coordinate so there is a 'line' that will be the trigger), for instance: -400.
- when camPos.Z = -400, set the 3D arrow to visible OR rescale to 1
Is this the correct way to do it? Or is there a better way?
I did try the simple (but obviously useless) logic by putting the codes in the while(device->run()) loop so that the camPos will always be updated, but somehow the IF statement always returns true from the start, therefore making the model visible.
If there was a similar thread to this query, could you direct me to it? Thanks all, help appreciated!
:)
I was wondering how do I make models disappear and reappear on certain conditions. For example:
When the player reaches a certain point on the map, a 3D arrow appears in front of the player.
What I had in mind is:
- initially set 3D arrow visibility to false OR scale it to 0
- always get camera position
- set Z coordinate to trigger (just took Z coordinate so there is a 'line' that will be the trigger), for instance: -400.
- when camPos.Z = -400, set the 3D arrow to visible OR rescale to 1
Is this the correct way to do it? Or is there a better way?
I did try the simple (but obviously useless) logic by putting the codes in the while(device->run()) loop so that the camPos will always be updated, but somehow the IF statement always returns true from the start, therefore making the model visible.
If there was a similar thread to this query, could you direct me to it? Thanks all, help appreciated!
:)