As things are at present the camera and scene move relative to each other - not sure what the default examine model uses but moving either one relative to the other has the same effect.
Indeed, moving a camera by vector V has visually the same effect as moving the 3D world by -V. This is a property of reality
Fun fact: This property is actually used by OpenGL and other graphic APIs. You can think that GPU camera is actually constant (standing at 0,0,0, looking in -Z direction) and the only thing you can do is move the world. Of course a higher-level engine, like CGE, gives you convenient properties to move camera in 3D, and independently move the 3D stuff, but that’s just using this “hardcoded camera” under the hood.
In case of our navigation classes TCastleXxxNavigation
, they only move the camera. That is, they change the Viewport.Camera.Xxx
vectors (Position, Direction, Up). They do not touch the world (they do not touch Viewport.Items
).
Anyway, this ‘Director View’ I have in mind would insert a camera object into it’s, static, view and you could see how the scene and camera move in relation to each other.
The idea to visualize camera through other camera is something I have planned for CGE editor. Indeed it is useful in 3D modeling software.
Doing this is fairly easy, you just create a TCastleScene, and you can use this scene to visualize a camera, by doing Viewport.Camera.GetView(Pos, Dir, Up)
and Scene.SetView(Pos, Dir, Up)
.
Where this gets interesting, and the whole point of the Director View concept, is if you then add a programmed path for the camera, something more complex than examine provides.
It comes down to an animation system, built inside the engine visual editor Since you would like animate transformations of 3D objects, like camera and scenes. It is something I would like to eventually have, but it’s a larger feature, so not for the immediate time.
Currently, if you need to design an animation visually – you have to do it in an external program like Blender and export to CGE (e.g. through glTF). Note that animating camera in Blender and exporting it to glTF works cool in CGE, I added a demo about it to GitHub - castle-engine/demo-models: Demo 3D models (mostly in X3D and VRML formats) of view3dscene and Castle Game Engine , in subdirectory gltf/camera_animation/
. You can have an animation that you can play, through CGE Scene.PlayAnimation
, and it will move the camera (assuming it is the current camera, which means that corresponding X3D Viewpoint is “bound”).