Original Post
Hi.
From previous posts, you may know that I am building a D3DIM engine from scratch (don''t ask my why). I have already made a 3D Studio .ASC file loaded; this was quite simple. However, at the moment if I want to texture an object, I add a special line to the .ASC file only recognised by my engine that specifies a file that contains all the texture co-ordinates (as they''re not included in the types of .ASC file I use). However, it''s obviously very tedious to put in all the texture co-ordinates for a model with 6 vertices, let alone 18! I''d also like to be able to map textures for dynamically-generated models.
So, I''m just asking you basically, what is the standard texture mapping alogrithm for calculating texture co-ordinates.
I''ve had a couple of thoughts:
(1) Map almost directly, using the X and Y vertex co-ordinates to calculate U and V, respectively (i.e. front on, it looks okay)
(2) Disperse evenly over the entire model using a total surface area calculation routine and then map the texture using the area of the face
So, what do you guys use?
- thanks