jim c Posted March 27, 2015 Share Posted March 27, 2015 (edited) 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): 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 - if I make the Y coordinate negative then it works. 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 March 27, 2015 by jim c Quote Link to comment Share on other sites More sharing options...
jim c Posted March 28, 2015 Author Share Posted March 28, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.