3D polygon to 2D texture coords

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

3D polygon to 2D texture coords

Post by dlangdev »

Just wondering if this is possible.

Given an obj file having vertex (v), vertex tex (vt), vertex normal(vn) and face (f). A scene is created having a node hierarchy(nh).

For static meshes non-animated, is it possible to generate a 2D texture map of the whole scene by walking the node tree and then map the quads (faces) onto a large scene texture?

Is that the way to go? should I walk the nodes, and for each node walk the faces and for each face(f), it gets mapped to a 2D texture?

Also, can I generate patches by using the faces as my given?

Thanks much.
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Well you can just loop through the indices and draw the vertices in 2D on a texture using their texcoords as absolute positions in 2d space (Be sure to fmod them first incase the texcoords are outside of the range 0-1).

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

never thought of that.

thanks for the tip.

looks like you're taking a phd on 3d space, huh?

i'm planning on getting an ms sometime later, most probably it's going to be 3d as well.
Image
Post Reply