Jump to content

camera path export plugin for softimage


photo

Recommended Posts

core/scripts/camera.h can be used as a camera path as manual said, and the format of camera path file is

position0.x position0.y position0.z rotation0.x rotation0.y rotation0.z rotation0.w fov0

 

then I also checked the manual, it only said the rotation, then I checked the 3dsmax export script. the rotation should be the original quaternion, but if this is the original camera quaternion, why the camera.h script need to inverse the rotation quaternion and do some more calculation like this:

quat rotation = inverse(lerp(rot[p0],rot[p1],time));
float fov = lerp(fov[p0],fov[p1],time);
vec3 z = normalize(rotation * vec3(0.0f,0.0f,1.0f));
vec3 x = normalize(cross(rotation * vec3(0.0f,1.0f,0.0f),z));
vec3 y = normalize(cross(z,x));
mat4 transform = translate(position);
transform.m00m10m20 = x;
transform.m01m11m21 = y;
transform.m02m12m22 = z;
player.setWorldTransform(transform);

 

so, what is the content of this rotation?

Link to comment

well :) :blink: I'm stupid, these values are just inverse quaternion of camera's rotation.

 

here is my contribute, the camera path export script for softimage, usage:

  1. select camera with animation you want to export
  2. set In/Out of animation range (not global in/out)
  3. select File>Export>Export Camera Path to export it

ExportCameraPathPlugin.rar

Link to comment
  • 5 years later...

Hi I know this thread is about 6 years old but i've stumbled across it trying to import a tracked camera into unigine. I wonder if you can help me, I have used your plugin, but I'm not sure what I should do with the text file. If you could enlighten me that would be greatly appreciated. 

Thanks very much.

Link to comment
×
×
  • Create New...