Raul,

        I have been getting better resuls with the new
definition of tAkool shown next.

tAkool=:3 :0
 assert 0 0 0 1-:3{y
 eye=. -3 7 11 {,y %. y*-.(i.4 4)e.3 7 11
 scale=.+/&.:*: eye
 's up nf'=. 3 3 {.y
 center=. eye-scale*nf
 eye,center,up
)

        There seems to be a flaw still because I always get
0 0 0  = center . For example, when I supply the following
inputs to gluLookAt

eye =. 0 0 6
center =. 0 1 0
up =. 1 1 0

the corresponding M produced (I call it Y) is
Y =. |:4 4$0.707107 0.707107 0 0 _0.707107 0.707107 0 0 0 0 1 0 0 0 _6 1

   round =: [ * [: <. 0.5 + %~
   0.001 round  3 3$tAkool Y
    0     0 6
    0     0 0
0.707 0.707 0

        The *output* results for eye and up are fine, but
not for center. Do you have any ideas for getting center?

        Btw, I don't really understand why the more
complicated version of eye is required, but I have a case
for which the complicated version gives a better answer.

(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to