Hey guys, I want to attach a gun Spatial to my camera node so it is always visible. I attached the Spatial to the cameranode and transformed its posiiton around a lot but still I can not see it. When I attached it to the root node I could see it but now I can’t… Any suggestions on how to fix this? Or is there a way in JME to sort of zoom out to see what I am missing maybe? Thanks
The problem is probably culling. A quick google search should give you some insight about this, and the forums should give you some results too (I remember posting about this some years ago actually ).
One way around it would be to use a sprite, that is a 2D image, or just a model and attach it to the GUI node. However, you would not receive any shadows on it. Another option would be to use a camera node.
This is already attached to the camera node. I’m not too sure how I feel about making it just an image… I want to move the gun around for reloading and stuff so an image wouldnt be appropriate for that
That’s true in your case. However, if I’m not mistaken you can attach a model to the guiNode, and if need be play animations. Give it a go
However, as I already said, you’d probably have a hard time getting shadows to work with the gun. I’d try and find a workaround using the normal viewport/3D node.
I am a completely newb to JME so I’m not to able in this field yet…
In that case, jME has some pretty neat tutorials. I suggest going over them first, getting to grips with the basics. Then, things will be much clearer.
The GUI node is a full scene graph, it’s just got a different projection, scale, etc. You can put 3d models in it if you want though.
@zarch said: The GUI node is a full scene graph, it's just got a different projection, scale, etc. You can put 3d models in it if you want though.
But… they will be z-flattened (z is scaled to 0, literally) and therefore there essentially is no depth buffer. Last triangle drawn wins which may look bad for anything but convex simple shapes.