Hiding an object

hi all. starting to learn jme… i couldn't find anthing in the documentation/forums about how to 'hide' an object? i want to press a key and hide it… will the children also hide? thanks.

of course…  :wink:

Take a look at Spatial.setCullMode(), make sure you read the javadoc of it.

great. that's what I was looking for . thank you for your time.

hi! I make by diferent way…In the method render() add



if(your_key_pressed == true){

  display.getRenderer().draw(rootNode.getChild(your_chlid));

}



:smiley:

hunter, that code doesn't hide an object but shows it :stuck_out_tongue:

Sfera,



Actually it would draw it based on the keypress state…so conversely, if the key was not pressed…yep, that's right, wouldn't draw it. :wink:



Hunter, seems a little redundant to do:

if(if(your_key_pressed == true){



instead of:

if(if(your_key_pressed){



doesn't it? :-p

darkfrog
darkfrog said:

Hunter, seems a little redundant to do:

if(if(your_key_pressed == true){



instead of:

if(if(your_key_pressed){



doesn't it? :-p

darkfrog


you asked too many questions and didn't close the parens --> if(if(
:P

Yes…sorry!



if(your_key_pressed){

It must be a bug in the forum…of course I could not have made a mistake.  :roll:



darkfrog