Hi people,
for my project I want to have multiple cameras that show different objects in the world; some objects are invisible from one camera and visible from another.
The idea is that the project has units with sensors. Each unit has a POV camera and there is one birdeye view camera. It is possible to switch the view from camera to camera. What I want is that every object is visible from the birdeye view camera, but in the view from a POV camera only the objects within the sensor's range are visible.
I have no idea how to do this. Does anyone has suggestions?
Well, you can adjust the camera frustum, but I think that wouldn't be enough.
What shape does the sensor range have?
Cheers,
Tim
You could force culling on objects you don't want to see each time you switch camera.
ie : hold a visible objects list and a cam for each unit, when you switch to a unit,
set culling on each object of the list to "dynamic"
mySpatial.setCullHint(Spatial.CullHint.Dynamic);
Set the active camera to the viewport
viewPort.setCamera(unit.getCam());
when you switch to another unit, set culling to "always" for each object of this unit.
mySpatial.setCullHint(Spatial.CullHint.Always);
Your bird view would be another unit, with all the objects of the scene in the list.
EDIT : i assumed you were using JME3, if you are using JME2, i guess there are similar features to change object culling and viewport camera