OvFw
OvFw

Reputation: 13

3D Projection (onto 2D) regarding attributes other than position, color

basically it is the same thing OpenGL does. I want to project a 3D model to 2D plane where the 3D model has vertices and faces which have many attributes along with coordinates or colors.

Namely I need several 2D projections of color, attributes1, attibutes2....attibutesN from 3D Model. Of course not every 2D projection need to render as am image.

Can I use OpenGL to solve the problem? What I understand from OpenGL projection or any model-view-transformation is about coordinate transformation. I how can let other attributes also "projected" to the proper place on 2D plane?

a quick idea is encoding vertex/face attributes in color or texture, letting OpenGL project the 3D model onto 2D plane, and then decode the color or texture value from each pixel on 2D plane.

Or is there any better solution which can be implemented without OpenGL trick?

thanks

Upvotes: 0

Views: 1038

Answers (1)

datenwolf
datenwolf

Reputation: 162317

Let V be the n-vector of n attributes you want to project, and M the (n+1)×m projection matrix, then M V is your projection. It's really that simple. What really matters, is finding a projection from n-space to 2-space that makes sense.

Upvotes: 2

Related Questions