2d image pixels mapping to 3d model

calif

Newcomer
I am new to 3d programming. I want to know if below is technically possible and what is the solution ?

Given a 2d image that is rendered from a 3d model, as far as I understand each pixel in the 2d image maps to a point (x,y,z) in 3d space in the 3d model from which the image was rendered. How do I find such mapping for all or any given pixel in the image? Is there a graphic rendering library that has the API ( prefer python or java) to generate this mapping file either during rendering process or some other way ?
 
Actually, it's the other way around. All "points" in 3D space (x,y,z) map to a "position" in 2d space (x,y). In case of clashes (multiple 3d "points" mapping to single 2d point), z buffer (also known as depth buffer) algorithm is used to resolve the matter.
 
There are both "forwards" mapping (take the texture pixels and blat them (with filtering) into the correct screen locations) and "backwards" mapping (given the screen location, work out which source texels are needed) but, for all intents and purposes, only the latter is used these days.

Perhaps a better question is to ask what you want to do with this "mapping file"?
 
I think he means uv mapping

for example player texture from unreal tournament


How do you arrive at that? do you paint directly onto the 3d model and a program extracts the textures
 
There is no painting is involved. The 3d model is rendered to 2d image. This rendering process knows about mapping each pixel to one or more points in 3d space taking into account lighting, shading and object visibility etc. So my question how do I get access to API that may be made available for this purpose in a given rendering product that offers scripting.

I am simply performing experiments about how to move objects in 2d image such that the corresponding 3d is also altered reflecting the new object positions in the 3d scene.

It has nothing to do with uv mapping or texture mapping. I could have other coordinate names like (m,n) to distinguish them from (x,y,z) 3d space coordinates.
 
Given a 2d image that is rendered from a 3d model, as far as I understand each pixel in the 2d image maps to a point (x,y,z)
Each pixel maps to a "line" in view space space ... you need 2D+Z to be able to do a reverse projection to (x,y,z) in view space (or model space).

Any way, just google gluUnProject and cite the beyond3d forum as a used resource on your assignment :p
 
Back
Top