RenderMan & RISpec >> 3D application camera to RenderMan transformation

by Nicholas » Sat, 03 Feb 2007 15:00:58 GMT

Hi,

In the past, I have hand translated the camera from various 3D
application to RenderMan coordinate system but recently I realized I
did not fully understand the mathematics behind them. Every new
application I tackle requires me to think through and sort of fumble
my way around.

Some application provides their camera with transformation
information like tx,ty,tz and rotx,roty,rotz while others, provides an
(eye, target, upvector) set of vectors. So far, most apps have been in
right-hand coordinate system and require translation to left-hand
coordinate system.

For the case of the (eye,target,upvector) case, I tried using the
information in Application Note #15 to get the require rotx,roty and
rotz angles.

Does anyone know of a good place to get a good understanding of the
camera transformation between 3d application and renderman?

Regards


RenderMan & RISpec >> 3D application camera to RenderMan transformation

by Moritz » Mon, 05 Feb 2007 11:13:04 GMT



Any book about 3D computer graphics. :)
RenderMan is not special in the way it defines a camera. It uses a
left-handed coordinate system, that's it. Using rotations and
translations (an maybe scales as well) stacked atop is just another
way, perhaps more human readable, of specifying what can, in case of a
RenderMan camera, be fitted into single 4x4 matrix for the orientation
and one RiProjection() call. Unless people need to re-orient the
camera by hand-editing the RIB..

So why not just use a 4x4 matrix with RiTransform()?
It's quite straightforward to go from e.g. eye, target, up to 4x4. And
the right-handed issue you can address by concatenating a negative
scale on z into the 4x4 matrix, then doing a RiReverseOrientation()
immediately after your camera transform definition.
I believe to recall that this is also what MtoR does. The advance is
that coordinates in the RIB reflect those in your 3D app.


Cheers,

Moritz

RenderMan & RISpec >> 3D application camera to RenderMan transformation

by Felipe Esquivel » Mon, 05 Feb 2007 13:33:01 GMT


Hi Nicolas,

I'm not sure to completely understand your question or exactly what
you don't have clear on this camera transformation topic. Maybe this
information may help you, if not just ignore this comment.

http://www.rendermanacademy.com/phpBB2/viewtopic.php?p=1937&sid=b802b6ffd30e9af1dde464a360e48420

Felipe Esquivel

RenderMan & RISpec >> 3D application camera to RenderMan transformation

by Nicholas » Tue, 06 Feb 2007 03:02:08 GMT


Thanks for th link Felipe

Your explaination and Application Notes #15 looks similar.

AP#15 does not calculate rotation-z (it uses a user supplied roll
value), neither does your explaination but I have found that there is
a need to for rotation-z to get everything aligned.

My question is either how to caculate rotation-z or if that is not
necessary, how to align them.

P.S. There seems to be a bug with the argument handling code in AP#15
(index out of range) but the rest of the code is fine.

Regards

RenderMan & RISpec >> 3D application camera to RenderMan transformation

by guanaco » Wed, 07 Feb 2007 01:40:56 GMT


PlaceCam is a good example http://www.dotcsw.com/doc/shadows.html

Similar Threads

1. [Q] OpenGL transformation to RenderMan conversion procedure

Hi,

    I have a sequence of OpenGL transformation call

        translatef(tx,ty,tz);

        rotatef(ry, 0 , 1, 0);

        rotatef(rz, 0 , 0, 1);

        scalef(scale, scale, scale);

        translatef(-cx,-cy, -cz);


    How do I order the transformation in RenderMan so that I end up looking
at the object the same ways as in OpenGL?

    Is the RenderMan call

        Scale -1 1 1

    sufficient (i.e. converts it from RHS to LHS). I have tried but it
doesn't produce the desired effect, maybe I have put it in the wrong place.

Cheers
-- 
YUE, Tan Meng (Nicholas)


2. Newbie: gluLookAt and camera transformation

3. 3D curve transformation algorithm

"Nigel" < XXXX@XXXXX.COM > wrote in message 
news:g5U8d.18990$ XXXX@XXXXX.COM ...

>    So from the above, I would like to find X,  the transformation (or set
> of possible transformations) that satisfy a match with {p} with some given
> error tolerance. I realize that X in genreal mayh not exist, or there may 
> be
> multiple solutions for X.

A curve and a set of points are two different beasts.
Is your intent to match a set of points to a set of
points?  Or will you fit both sets with curves and
then try to match the curves?  The algorithms are
typically different for the two approaches (matching
sets uses discrete concepts, matching curves uses
continuous concepts).


4. 3D Point Matching , Matrix Transformation

5. 3D orthographic projection using only 2D affine transformations

hi,
i'm not sure if the subject is adequate; i'm trying to "fake" an
orthographic projection of a 3D scene on a platform where only 2D
vector transformations are accelerated.

i'm not sure if this is possible in general; if not that's fine (i.e
if it will only work given certain constraints on the orientation of
polygons/etc. that's okay).

thus far i've been able to properly transform "planes"; my worldspace
has x,y as the ground plane and z as the "up" axis. the camera can
rotate around the z axis (turn left and right) and tilt up/down, but
cannot twist (rotate around the view vector).

given a set of polygons all lying on a plane parallel to the x,y
plane:

-draw the polygons onto a 2D surface (i.e draw them onscreen/onto a
texture as if the plane containing the polygons is parallel to the
screen)

then, transform the surface in this order:

-rotate the surface (the point around which to rotate them is the
camera's position projected on to the plane which contains the
polygons)

-scale the surface in (screenspace) y, based on the "tilt" of the
camera

this works for planes which are parallel to the x,y plane; for planes
parallel to x,z and y,z, i've found that adding a skew/shear after the
rotation seems to work.

is this possible to do in general? and if so, what would be some good
keywords to feed google? so far all i can find are university compsci
graphics texts (which i've got enough of).

in case you can't tell i'm pretty much stabbing in the dark here ;) 

thanks,
raigan

6. Linear transformations vs rigid transformations

7. 3d rigid transformation

Hi everyone,

I need some help with what are considered 3d rigid transformations.
Are they just translation and scaling or also rotation in one axis?

Thanks
Vasileios Zografos

8. Transformation 2D to 3D