3D Maths

#1

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.

Cheers,

Jas

#2

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.

#3

The Graphics Gems series are good books. Game programming sites usually have tons of articles and examples as well.

#4

Here is a very simple tutorial … written for a basic programmer, but not hard to decipher.

It will get you drawing a cube at least.

http://www.petesqbsite.com/sections/tutorials/tuts/3dprog_chronomaster.txt

It is pretty hard to find to tutorials that don’t assume DirectX or OpenGL being available.

-Eric

#5

Found this set of presentations. Check Viewing, Projecting and Picking.

http://www.essentialmath.com/tutorial.htm

#6

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 )

Jas

#7

Hi, what you are trying to accomplish can be done with “ray tracing” and the book CUDA BY EXAMPLE has an easy example(surprise!!) of it using spheres.

#8

Jas,

Here are some books that I used for my MS project a “few” years ago:

and the Graphics Gems series…

Jim

#9

Thanks for the advice. I’ve jumped back to XNA for a while to try and understand and create a simple 3d engine on my windows phone.

For anyone else interested in this kind of thing. Some kind soul has posted a course on XNA 3.1 which works just as well for 4.

http://www.xnavideotutorial.com/modules/XNA_201/

This is where I’ve started from:

http://vimeo.com/12309196

Cheers,

Jas