|
|
I'm trying to get this bit of java code to create
from/to/up/right/ statements for povray but am
failing miserably! Is there someone hear that
help me line this bit of code up with povrays
internal camera ? Are my settings for U,V, and N
corresponding with povray's notion of a camera ?
Any help **GREATLY** appreciated!!
mailto:mla### [at] ixnetcomcom
gVector V = new gVector(0.0, 0.0, 1.0, 1.0);
gVector U = new gVector(1.0, 0.0, 0.0, 1.0);
// this "from" and "to" are the ones
// output for the povray "from" and "to"
// statements
gVector N = new gVector( from.x-to.x, from.y-to.y, from.z-to.z );
l = N.length();
N.x /= l;
N.y /= l;
N.z /= l;
// Right
V3Cross( N, V, U );
l = U.length();
U.x /= l;
U.y /= l;
U.z /= l;
// Right is for the povray "right" statement
Right.set( U );
// Up
V3Cross( U, N, V );
Up.set( V );
// Up is for the povray "up" statement
vm.ident();
view_transform( from, U, V, N, vm);
/***** and the matrix turns into
Ux Vx Nx 0
Uy Vy Ny 0
Uz Vz Nz 0
-from.x -from.y -from.z 1
*****/
Post a reply to this message
|
|