Hi,
Can anyone point me towards a book or document where I can learn some basic 3d maths. Enough to be able to plot a point (x, y, z) onto a 2d screen. I’m sure my brain will try to explode when I try to comprehend. I’m basically trying to draw a 3d primitive wire-frame object on the Spider, like a cube etc.
Or does a library already exist somewhere to do this kind of thing.
I’m sure with google, you’ll find a lot of information and code.
Once you have the 3D data (x,y,z coordinates), you might want to transform them using 3x3 transformation matrices. So you’ll need to implement a matrix multiplication function. (search transformation matrix, rotation matrix, etc)
Showing a 3d model on a 2d screeen is essentially:
Defining a viewport (== defining center, scale, perspective, etc).
Drawing stuff at the x,y coördinates, and use the z value for ordering. You can keep all coördinates ordered by its z value in an array. And drawing happens from the back to the front.
You also need the z value to apply perspective view. The closer an object is to the viewer, the wider x/y coördinates are apart from the center. So you simply multiply x and y coördinates with a fraction of the z value.
Thanks for all the suggestions. I’ll try to have a read through at the weekend when I can switch brain over from work to play.
@ Eric, that has been my problem, everything assumes that you are using some graphic language. (Which as far as I know do not exist in the .nmf world )
Here are some books that I used for my MS project a “few” years ago:
An Introduction to Ray Tracing, Xerox PARC, published by Academic Press/Harcourt Brace Jovanich
Advanced Animation and Rendering Techniques, Alan Watt and Mark Watt, published by Addison-Wesley
Fundamentals of Three-Dimensional Computer Graphics, Alan Watt, published by Addison-Wesley
and the Graphics Gems series…