Jump to content

Houdini to renderman/RIB coordinates


Recommended Posts

I'm writing a little utility to export parts of a scene to a a series of rib files that can be loaded in prman.

But I'm having problems exporting something that generates the correct transform for the camera.

 

The goal pic (ignoring the shading for now):

post-4235-0-94619200-1427424944_thumb.jp

 

FOV is built like so:

fov = 2.0*math.atan(renderCam.parm("aperture").evalAsFloat() / (2.0*renderCam.parm("focal").evalAsFloat()))
fov = math.degrees(fov)
print "Projection \"perspective\" \"fov\" [%0.5f]" % (fov)

So far I'm able to generate a rib file like so

Display "test1" "framebuffer" "rgb"
Projection "perspective" "fov" [45.00004]
Format 640 480 1

ConcatTransform  [ 1.00000  0.00000  0.00000  0.00000  

0.00000  1.00000  0.00000  0.00000  

0.00000  0.00000  1.00000  0.00000  

0.00000  0.83360  3.19907  1.00000  

 ]



#adjust to Houdini's right hand coord system

Scale 1 1 -1



WorldBegin

     ReadArchive "geo2.rib"

WorldEnd

This works, but the camera is in the wrong position

 

post-4235-0-36459400-1427425451_thumb.jp

 

 

- if I make the Y coordinate negative then it works.

post-4235-0-75483900-1427425541_thumb.jp

 

 

So there's something stupid that I'm missing, but I'm not sure what it is. the data that's in ConcatTransform is built like so:

mat = renderCam.worldTransform()
matStr = ""    
for m in mat.asTupleOfTuples():
    for n in m:
        matStr += "%0.5f  " % n
    matStr += "\n"
 
print "ConcatTransform  [ %s ]" % (matStr)

As far as I can tell this is right, but the results obviously are not :) Any suggestions as to what I'm missing or doing wrong?

 

Edited by jim c
Link to comment
Share on other sites

In case any should ask, I am aware that there's a renderman output node ROP, but this doesn't work with Apprentice or Indie versions, so if I want to export the scene I've to come up with something homegrown (which i don't mid doing, it's sort of interesting to see how renderman works). Which is the point of what I'm trying to accomplish in the original post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...