Forum

A simple way to translate camera?

11 September 2017 22:46
Hey all,

I'm using a screen shooter in my configurable 'room' template, but I'd like to add a functionality where I get 3 shots from pre-determined camera positions.

I'm doing 'reasonably' well with target_set_pivot_translation and the various other Camera module API calls, but it just seems so convoluted.

Is there a way I can simply translate my scene's camera position ('Location', 'Rotation' 'Scale')? So I can find the right framing in blender and copy over the data into B4W?

Thanks in advance

Charlie
12 September 2017 06:02
Logic nodes are very handy to move the camera. The Move Camera node take three parameters. First select the Camera (usually, you only have one). Then you select an object to be the location the camera will move to. This object can be an empty or a 'Hidden' object named something like cam_loc_1. Next you select an object for the camera to look at. Could be another empty named cam_target_1, or a visible object. You can also select the duration of the move in seconds. One would be a one second transit, zero would be instant. If you want to trigger this with code, you can use run_entrypoint(). Then you make the Move Camera node run from an Entry point in the Logic Node Editor that can be activated from code. You need to name your Entry Point node so the JavaScript function has a handle for it.. Select the node, hit N key to open the side tool panel and give it a name. You can throw in a Set Camera Move Style node too.
The beauty of this is that to adjust the camera positions, you just move the camera locator objects around.
 
Please register or log in to leave a reply.