Heya.. I'm having a problem with my Camera code.
I'm going to post it, and my math code module as well.
Hopefully someone can see a mistake :)

A quick description of the problem:
If I set up the initial camera view vector as (0,0,1) and then move forward/backward, I get motion in Y as well as in Z...
Posted on 2004-11-20 21:41:56 by Homer
i dont know if that's the cause, but i see that Camera_Look proc (the one at the end of Camera_ClassDef loads 9 numbers into the FPU. as i remember the FPU has only 8 registers :-D

...it's 5:18 AM, so sorry if i'm just stupid :P
Posted on 2004-11-20 22:19:29 by ti_mo_n
THAT WAS IT !!! THANKS :)

(plus a small bug in Vec3Normalize - I post fix here)


; This returns a normalize vector (A vector exactly of length 1)
Vec3Normalize proc uses esi pNormal
local fmag
invoke Vec3Magnitude,pNormal ; Get the magnitude of our normal
fstp fmag

; Now that we have the magnitude, we can divide our normal by that magnitude.
; That will make our normal a total length of 1. This makes it easier to work with too.
mov esi,pNormal
fld [esi].Vec3.X
fdiv fmag
fstp [esi].Vec3.X
fld [esi].Vec3.Y
fdiv fmag
fstp [esi].Vec3.Y
fld [esi].Vec3.Z
fdiv fmag
fstp [esi].Vec3.Z
ret
Vec3Normalize endp
Posted on 2004-11-20 22:30:54 by Homer