Engine crashing due to camera angle?

Started by
11 comments, last by Ruudje 18 years, 4 months ago
Things like resetting VPUs are mostly caused by buffer overruns or invalid indices - you better double-check your 3DS rendering code. I really can't imagine how any messed up camera matrix could cause such problems.
Are you by any change using VAs or VBOs? If so, take a close look at those. If not , check your 3DS loader for invalid indices.

HTH,
Pat
Advertisement
Try changing your up vector to (0,1,0). If that solves it then it is the angle you are using. Specifically you are hitting an angle where both sin and cos are returning zero. Not because the sin and cos of any given angle are both zero, but because you are so far out of the interval of convergence. You should use something like (((float)(timeGetTime() / A) % B) / B) * 2*PI to calculate the angle. The loop given above is wrong. It's wrong because it will most likely produce a huge negative angle and wrong numerically because you can't subtract your way back into range when you are so far out of range.

You should change how you calculate the angle regardless. What you're doing should be producing fairly irratic movement. If changing that up vector doesn't eliminate the crash then changing how you calculate the angle won't eliminate it either. Changing the up vector eliminates the possibility that you are generating (0,0,600) as the point you are looking at. The other major error you could make with LookAt is to look at the point the camera is at, but with the hardcoded 0 and 600 that isn't likely.

It is possible. How it can happen is addressing memory incorrectly. When you start stomping on memory all kinds of impossible things become possible. If you haven't commented out the call to render the scene then you might want to give it a try. It would make no sense that doing that would fix the problem so if it does then you most likely stomped on memory in that routine. If it stops the crash then obviously something in there was causing it.
Keys to success: Ability, ambition and opportunity.
Changing the up-vector didnt help.

I'm using the 3ds-loader from www.morrowland.com. Used it before in a project and it worked fine then...

This topic is closed to new replies.

Advertisement