views:

44

answers:

2

Hey this may sound simple but it escapes me,

I have a list of 3D points (including negative positions) that I would like to map onto a 2D Texture.

I'm trying to figure out how to map the points appropriately to the texture and how it differs if it has a specific width/height.

Thanks

A: 

In my experience, usually you specify the 2D texture coordinates in your model using glTexCoord2f (one for each 3D point), and let OpenGL take care of the rest.

Maybe I am misunderstanding what you are trying to do here.

bde
I'm trying to draw on my bitmap without openGL and therefore I ened to figure out myself how it projects the 3D point onto the texture.
Setheron
+1  A: 

The simple way: using ortographic projection.

x_2d = x_3d + z_3d * scale_x

y_2d = y_3d + z_3d * scale_y

Where (scale_x, scale_y) is a vector describing the "direction" of the projection.

If objects with an high position ("far away") should be smaller you should search for perspective projection (e.g. on Wikipedia: 3D Projection)

Jens Nolte