Line 107:
Line 107:
return 0;
return 0;
}
}
+
</source>
+
+
== Note on Projection Matrices ==
+
There are a lot of tutorials and projects out there that are using standard 'Mtx' variables for projection matrices. Although this works in many cases (because the variables declared right after the matrix don't mind being corrupted once or twice), this is not correct, and is a crash waiting to happen. These matrices should be declared as 'Mtx44' objects instead. Note the prototypes for the projection matrix functions (see "ogc/gu.h"):
+
<source lang="c">
+
void guFrustum(Mtx44 mt,f32 t,f32 b,f32 l,f32 r,f32 n,f32 f);
+
void guPerspective(Mtx44 mt,f32 fovy,f32 aspect,f32 n,f32 f);
+
void guOrtho(Mtx44 mt,f32 t,f32 b,f32 l,f32 r,f32 n,f32 f);
</source>
</source>
[[Category:Development]]
[[Category:Development]]