Setting a proper camera transform
See original GitHub issueHello everyone, and first of all thank you @mikedh for the insane work put into this library. I am trying to use this in a few projects, especially for raycasting and some quick renders.
I have been trying for a while to set a custom camera transform, but I only managed to get myself a headache since there seems to be some weird convention going on with transform matrices. My questions are:
- How can I use the
trimesh.scene.set_camera
method to define a camera viewpoint starting from a regular 4x4 matrix containing camera pose and 3D position with respect to the world reference frame? - If there is a differerent convention in defining such reference frames, where can I find more info? Is there anything in the trimesh documentation?
Thank you in advance F
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Camera Settings guide – The 15 best photography settings
Camera settings in photography are key to take quality images. Learn the best settings, dials, and buttons with this camera settings guide!
Read more >Transform Your Photos With This Setting In Camera Raw
FOLLOW MEINSTAGRAM: http://www.instagram.com/jessicakobeissiFACEBOOK: https://www.facebook.com/jessicakphotoSNAPCHAT: ...
Read more >Easy to Understand Guide to Camera Settings for Beginners
Master your camera settings with this easy-to-follow guide for beginners, including pro tips you can use to keep improving your photography in 2022....
Read more >Tutorial 13 - Camera Space - OGLdev
This function generates the camera transformation matrix that will be used later by the pipeline class. The U,V and N vectors are calculated...
Read more >Common Camera Settings for Beginners - Photography Life
Camera Setup · Best Camera Shooting Mode · Best Autofocus Mode · Best Metering Mode · Best Lens Aperture · Best Shutter Speed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fbottarel I found the solution. The camera_transform is world to camera transformation matrix (or reverse, I can’t tell to be honest, try inverse if it doesn’t work). But the weird thing is that you need to rotate your mesh with the following transformation before feeding into the rendering pipeline:
So if you got pyrender rendering working, then simply pre multily the camera_pose matrix and that’s your camera_transform that trimesh expects.
Yes, there are some conventions to be followed. Different platforms use different coordinate system. (example)
For LineMOD dataset, I found that you need to multiply y and z axis transformations with -1 to correctly render in Trimesh.