POV-Ray : Newsgroups : povray.programming : ? camera matrix Server Time
29 Jul 2024 06:18:49 EDT (-0400)
  ? camera matrix (Message 1 to 1 of 1)  
From: morgan larch
Subject: ? camera matrix
Date: 27 Aug 1998 13:12:00
Message: <35E58396.13D51FB3@ix.netcom.com>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.