POV-Ray : Newsgroups : povray.general : Calc matrix coefs : Re: Calc matrix coefs Server Time
26 Apr 2024 06:41:40 EDT (-0400)
  Re: Calc matrix coefs  
From: Melody
Date: 25 Dec 2019 05:50:00
Message: <web.5e033d81ce9dbf349da690110@news.povray.org>
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

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