1
\$\begingroup\$

I need to make a human 2D face to 3D face. I used this link to load an ".obj" file and map the textures. This example is only for cube and pyramid. I loaded a human face ".obj" file.

This loads the .obj file and can get the human face properly as below. enter image description here

But my problem here is I need to display different human faces without changing the ".obj" file. just by texture mapping.

But the texture is not getting mapped properly, as the obj file is of different model. I just tried changing the ".png" file which is used as texture and the below is the result, where the texture is mapped but not exactly what I expected, as shown below.

enter image description here

The below are my few questions on it :

1) I need to load texture on same model( with same .obj file ) with different images. Is it possible in opengles?

2) If the solution for above problem is "shape matching", how can I do it with opengles?

3) And finally a basic question, I need to display the image in large area, how to make the display area bigger?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The texture map needs to be explicitly created for the model.

More accurately, the model includes a UV coordinate for each vertex that maps each vertex to specific points in the texture map. Generally this is done by creating a model and "unwrapping" it, which generates a template texture map file that an artist can paint to create the final model. This painting is generally done after the model geometry is all finished, as small tweaks to the model geometry will often necessitate drastically different unwraps (even when controlled by an artist and not done auto-magically by tools).

This UV mapping means that a texel mapping to the center of the left eye may be at texture position 20,20 for one model, but texture position 400,50 for another. If you open the face texture, you'll see bits of face all over, and a lot of stretching, with odd "cuts" in certain places. Those places varies for each model based on how UVs were unwrapped for its specific geometry. The texture map has to match these UV coordinates or you get the garbled effect you're seeing.

Short version is that if your .PNG is not made for the .OBJ you're using, it won't work. You can't grab some random face texture and some random head model and expect things to look right.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for your answer..stackoverflow.com/questions/8951492/ios-2d-image-turn-into-a-3d A discussion here says that it would be possible and that why I continued. I want to do a application like morfo:itunes.apple.com/us/app/morfo/id418900007?mt=8. Any tips from you? How can I proceed from here? Please advice... \$\endgroup\$
    – 2vision2
    Commented Mar 12, 2013 at 7:55
  • \$\begingroup\$ The answers to that question are unrelated. That is about taking a 2D photo and UVwrapping on it for a specific model. Nothing about taking an existing set of unwrapped UVs and applying them to any random UV mapped face texture. \$\endgroup\$ Commented Mar 12, 2013 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .