# Projection in 3D graphics

1. Aug 4, 2011

### Jaynte

When it comes to graphics (what I have learned) is that what you see on the screen is data placed in a memory (video buffer) and then the data or pixel is then plotted onto the screen. So when you manipulate the data in the video buffer you will also manipulate the pixels on the screen.

Then it crosses my mind that when you want to plot 3D images on the screen, you can see the video buffer as a 2D plane which you can project 3D object onto.

I guess this is how it's done, but I wonder which of these two is the most common or the best way to implement this method when you want to turn and rotate an object in space?

1)
Having the 3D object fixed in space and rotate the surface which will become the video buffer.

2)
Having the surface (video buffer) fixed and rotate the object.

What im guessing is if you use method 1) you don't need to transform as many vectors but then you cannot use more than one object which you can in method 2).

2. Aug 4, 2011

I did an OpenGL course last semester, but I'm no pro.

When you require a rotation, you can either rotate the object OR rotate the "camera" around the object. Both methods only require you to transform the vectors for the "thing" you are rotating (be it a modelled sphere, or the "camera"). When I say camera, I mean the viewpoint of the user, but I think the analogy is natural.

The video buffer does indeed contain a 2d projection of the 3d scene, but you don't rotate it per se, it just contains the flattened 2d image of all of your rotations and transforms, lighting, etc as seen via the "camera".

Personally, I found it easier (conceptually) to rotate things in my scene, controlling the camera was quite a bit harder, although sometimes you need to do both.

Last edited: Aug 4, 2011
3. Aug 5, 2011

### Jaynte

Ok thanx. Yes that sounds reasoneble. If you want to move the whole sceene you should move the camera.

4. Aug 5, 2011

### DavidSnider

It's usually broken up like this:
Model Space -> World Space -> View (Camera) Space -> Projection Space -> Screen Space

5. Aug 5, 2011

### Jaynte

What does world space means? Is it just an empy space or could is also contain fixed stuff such as llandscape etc? And why does the camera need its own space? Couldnt it be chared with world space?

6. Aug 5, 2011

### chiro

World space is when all the objects go from their own local space to the global coordinate system.

Say if you were doing a model of the solar system. The world space is a coordinate system with the sun at the origin. Each planet is centered at some point and has its own rotation properties.

Let's assume that the orbits around the sun are circular (and not elliptic like they really are). You combine translation and rotation matrices in a composition with the world matrix to get all of the coordinates in terms of the world matrix.

Basically the whole process is just a composition of matrices. The order depends on what you are trying to calculate, but like the above poster said you start by calculating local transformations and then compose these results with higher level transformations (world, camera, and so on).

7. Aug 6, 2011

### Jaynte

Thanx, now i get it.