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...

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...

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

...it's 5:18 AM, so sorry if i'm just stupid :P

THAT WAS IT !!! THANKS :)

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

(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