Groups | Search | Server Info | Login | Register


Groups > comp.graphics.rendering.renderman > #58

Basic question on transformations

Newsgroups comp.graphics.rendering.renderman
Date 2015-04-17 19:39 -0700
Message-ID <2d3da870-b53d-4737-a4a0-0432b44a70f3@googlegroups.com> (permalink)
Subject Basic question on transformations
From Yannick Duchêne <yannick_duchene@yahoo.fr>

Show all headers | View raw


Hi people,

That's a question I wanted to ask on the AQSIS forum, but it seems empty now and I can't log into it.

I'm unable to figure why an axis goes the opposite expected side. I was surprised to meet this issue, as I'm not totally new to Renderman.

First the sample RIB file, then an image of the result then the explanations of what I expected and how the result differs from what I expected.

Sample RIB, named `test4.rib`:

    ##RenderMan RIB-Structure 1.0
    version 3.03
    # test.rib
    Exposure 1.0 2.2
    Format 800 600 1.0
    Projection "perspective" "fov" 40
    Display "test4.tif" "tiff" "rgba"

    Translate -3 -2.5 8
    Scale 1 -1 1
    Rotate 90 1 0 0

    WorldBegin
       TransformBegin
          Color 0 0 0
          Sphere 0.06 -0.06 0.06 360

          # X axis
          Color 1 0 0
          Rotate 90 0 1 0
          Cylinder 0.03 0 5 360

          # Y axis
          Color 0 1 0
          Rotate 90 1 0 0
          Cylinder 0.03 0 5 360

          # Z axis
          Color 0 0 1
          Rotate -90 0 1 0
          Cylinder 0.03 0 5 360
       TransformEnd
    WorldEnd


The result I get:
http://www.les-ziboux.rasama.org/exported/test4-result.png

What I expected:
http://www.les-ziboux.rasama.org/exported/test4-expected.png

Seems for Y axis, I have to `Rotate -90 1 0 0` instead of `Rotate 90 1 0 0`, and I don't understand why.

Here is my understanding (sorry for being verbose):

 * RenderMan default coordinate system, has X axis going rightward, Y axis going upward and Z axis going inward.

 * I want a displayed coordinate system where X axis go rightward (as the default), the Y axis go outward and the Z axis go upward.

 * First, I added a rotation around X axis (`Rotate 90 1 0 0`), to rotate the Y axis toward the Z axis, so that X goes rightward (unchanged), Y goes outward and Z goes downward.

 * Then, as Z now go downward, which is not expected, I added a scale to invert Z's direction (`Scale 1 -1 1`), so that it go upward.

 * I draw a sphere at the origin.

 * I draw the X axis using a thin and long red cylinder. For this purpose, I have to rotate the X axis so that it takes the place of the Z axis, a rotation around Y axis, with the X axis going toward the Z axis, in the world coordinate system: `Rotate 90 0 1 0`.

 * The X axis is drawn as expected.

 * Now I want to draw the Y axis using a thin and long green cylinder. For this purpose, I have to rotate the Y axis so that in takes the place of Z axis, a rotation around X axis, with the Y axis going toward the Z axis in the word coordinate system: `Rotate 90 1 0 0`.

Seems there is an issue I don't understand here. If I do this, the Y axis is drawn inward instead of outward and I have to use `-90` instead of `90` for the rotation. I don't understand why.

There no issue when drawing the Z axis, neither with the X axis, only when drawing the Y axis.


Where have I made an erroneous assumption? With the prior world coordinates transformations or with object coordinates transformations in the world coordinates?


P.S. As question aside, do someone know what happened with the AQSIS forum? Will it be reopened? I registered in the new forum, but signing-in seems to not work.

Back to comp.graphics.rendering.renderman | Previous | NextNext in thread | Find similar


Thread

Basic question on transformations Yannick Duchêne <yannick_duchene@yahoo.fr> - 2015-04-17 19:39 -0700
  Re: Basic question on transformations Yannick Duchêne <yannick_duchene@yahoo.fr> - 2015-04-17 19:41 -0700
  Re: Basic question on transformations Yannick Duchêne <yannick_duchene@yahoo.fr> - 2015-04-17 22:28 -0700

csiph-web