On 06/07/2016 at 15:47, xxxxxxxx wrote:
In python, How may I set the "lookat" position of a camera programmatically?
In particular, I am specifically interested in setting the orientation of the EditorCamera to look at position (0, 0, 0) (the center scene).
I imagine there is some matrix math that could be done but I'm not sure how to do it in C4D, and was hoping there was an easy way to update the EditorCamera matrix so that it maintains the poisition but changes the orientation to look at the center of the scene.
The only way I can see to do this without knowing the matrix math is to create a dummy camera at the EditorCamera position, create a dummy object at the center of the scene, add a Target tag to the dummy camera, set the target to the dummy object, copy the "Mg" to the EditorCamera, then delete the dummy object and dummy camera.
There must be a better way!
Any help would be much appreciated.