Archived

This topic is now archived and is closed to further replies.

Impz0r

How to store textures?

Recommended Posts

Hi, I''m interested in "how store textures for an mesh". I''ve code a lilte 3d engine, and i run in confusion, at that point where the question came up, how to store my textures for an mesh. I will try to explain where my problem lay. I''ve an mesh , it''s an cube (for this example *g*), the six side of this cube have different textures, mean i have six textures at all. Ok but my mesh is one array of vertices, normals, texture coordinates. So how did i know while i''m rendering, which texture must set to my renderer, and which not. Must i store for every polygon an id that identify the correct texture??? Or im totaly wrong here?? Pls help me out in my confusion :D Thx Imp bugs are uncommented features...

Share this post


Link to post
Share on other sites
For flexibility (3DS format for example): store position, normal, color, material, texture id and coordinate for each vertex.

For speed (md3 format): group vertex who share the same info and use strip and fan polygons.

Share this post


Link to post
Share on other sites
hi,

first, thx for your fast answer :D

That means i''m lay right with my solution, to store for every polygon an id to identify the correct texture. Is that the best way, you explain here, or is there an other, better solution to do this well???


Thx Imp

Share this post


Link to post
Share on other sites