For a while I've been wanting to dive into ASL and learn how to make useful stuff.
For a while I've been wanting to make a .rib converter for anim8or.
So I'm finally getting something done about it...it's nowhere near finished but I've got one good part done, actual meshes export properly (big thanks to Steve's export scripts as a foundation...the ASL documentation finally makes sense!).
My plan is to make it a toolset that allows you to use the object editor as a scene editor to make very nice still renders. I'll build shape plugin scripts where you can make a camera shape, light shapes, dummy shapes, etc where you can specify different parameters like camera FOV, light types and colors, shadows, and move and rotate the camera and lights like it was a real scene and it'll export it accordingly.
(http://raxx.cg-nation.com/ASL/RIB/robin_RIB.gif)
I might go one-sided and make it support only the Aqsis renderer (or something else I find) since it's free and easy to install. Making it dependent on a single renderman renderer will allow me to utilize the wowee features that are specifically built for them ;) but that's way in the future.
I'm not releasing anything yet. Once I get to the stage where it'll actually become halfway useful, then I'll start releasing the stuff. I'm just posting here my updates as I go along to keep things interesting.
I know one of you ASL/programmer junkies could probably whip out something better than what I've got so far like it's nothing but you just wait and see :P
Thanks! I had a feeling it'd be something like that.
(http://raxx.cg-nation.com/ASL/RIB/RIBRobin_camera.gif)
The only difference in look and feel between this camera and the scene camera are the reels on top
Camera shape is done and allows you to set the width, height, FOV, near clip, and far clip and when doing so the shape updates accordingly...now I'm stalled by the fact that you can't grab parameters from parametric shapes via scripts other than plugin scripts. This should be extended to any script! I've got some tricks to bypass the problem but it makes it 2x more difficult for me :P
Wait, I think I mistaken your problem.
If I got it right, you already have cam's orientation and position worked out, correct? Now the thing you want to do is to calculate the inverse orientation and offset of the entire scene (if I got it right once again).
I met a similar problem while working on the magnet scripts, and I ended up with this code (snipping another post of mine):
quaternion $mag_q, $clay_q;
$mag_q = $magnet.orientation;
$clay_q = $clay.orientation;
float4x4 $mag_rotmat, $clay_rotmat;
$mag_rotmat = toFloat4x4($mag_q);
$clay_rotmat = toFloat4x4($clay_q);
/* invert orientation quaternion for building inverse transformation */
$mag_q = ( -$mag_q.x, -$mag_q.y, -$mag_q.z, $mag_q.w);
$clay_q = ( -$clay_q.x, -$clay_q.y, -$clay_q.z, $clay_q.w);
float4x4 $mag_inv_rotmat, $clay_inv_rotmat;
$mag_inv_rotmat = toFloat4x4($mag_q);
$clay_inv_rotmat = toFloat4x4($clay_q);
If you want to, you can change a simple point go back and forth on the two systems using code like this:
/* translate clay point to magnet's coordinates */
$clay_p = $clay_rotmat.Project($clay_p) + $clay_l - $mag_l;
$clay_p = $mag_inv_rotmat.Project($clay_p);
...and back:
/* translate back clay point to clay's coordinates */
$clay_p = $mag_rotmat.Project($clay_p) - $clay_l + $mag_l;
$clay_p = $clay_inv_rotmat.Project($clay_p);
But if your problem involves changing the orientation quaternion of each object, then I think this link could help you more than me:
http://www.flipcode.com/documents/matrfaq.html
I did not face nor dig this passage in particular, but I think it's about multiplicating quaternions together... have a look and good continuation.