|
|
example rotate matrix, used on lego plane_10.
#local U = rotation(radians(flightpitch),Right,Up);
#local E = vnormalize(vcross(Right,U));
// #declare E = rotation(radians(flightpitch),Right,Eye);
// #declare r = vnormalize(vcross(y,e));
// #declare u = vnormalize(vcross(e,r));
// #declare e = vnormalize(vcross(r,y));
object { plane_10(1,0,1,0,0,0,0,frame,frame,0,60,60,90,90,0,0,0)
scale .007
rotate 90*y
pop_matrix(Right, U, E)
translate (campos - U*.64) + (U*.045) + Eye * 4
.....
WHICH DIRECTION is right up eye?
use the included cross-product order.
could have rotated both up and eye around right, didnt have to.
vcross() : cross product is not a length of 1, normalize.
I use the rotation(r,axis,p) in triangulation.inc, refused to learn another
parameter order. and another in triangulation.inc
#macro pop_matrix(A, B, C)
transform {
matrix <A.x, A.y, A.z,
B.x, B.y, B.z,
C.x, C.y, C.z, 0, 0, 0>
}
#end
Post a reply to this message
|
|