POV-Ray : Newsgroups : povray.advanced-users : Can I apply the camera transform matrix to objects? : Can I apply the camera transform matrix to objects? Server Time
28 Jul 2024 12:33:44 EDT (-0400)
  Can I apply the camera transform matrix to objects?  
From: zachrahan
Date: 6 Sep 2005 14:45:00
Message: <web.431de37ea8436e23a205a1b30@news.povray.org>
I'm trying to figure out a way to get some objects to always "point" at the
camera, no matter where I move it. (Imagine an array of solar mirrors
mounted on gimbals so that they always point at the sun.)

Anyhow, I can see two ways I might do this in povray:

(1) If there were some way I could obtain the camera-to-world transform
(that is, the inverse of the world-to-camera transform, unless I've gotten
the two backwards) and apply that to objects in the scene, then this would
have the effect of "undoing" any camera motion so the objects always
"point" at the camera in the same orientation.

(2) If there were some way to specify the orientation of objects via
"lookat" and "sky" parameters, as you can with the camera, I could just set
the camera and the objects to look at each other, with a common sky vector.

Option 2 is neat because it's more general -- you could have objects all
point at any arbitrary thing. However, I don't see anything like that in
the documentation, so I assume that it's probably option 1 or nothing?

Now, I know the math needed to convert lookat and sky vectors to real
transform matrices, so I could do this outside of POV and just directly
enter a matrix transform for the objects, but that's a little more brittle
and prone to bugs and (more importantly) slight mismatches in how I apply
the math versus how povray does it which could lead to jitters in
animations. If this were possible to do within povray, I'd prefer to do it
that way.

Thanks,
Zach


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.