PDA

View Full Version : LWO conversion for games


Bastich
03-21-2003, 11:56 AM
Hello

I have recently written an entire LWO2 file loader for use in my game engine. The problem is that when I convert the model all the texture mapping is in planar mode (Y Axis) so the top of the model is fine and then down the sides the texture is just smeared. I personally do not generate the models and only know enogh to view them on the artists PC. On his PC however all faces are displayed correctly. When I decode the LWO2 file it says in the Surface Blok chunk that the texture is in Planar mode.
How do I convert this into real UV coordinates for use in OpenGL / DirectX apps.

Please help as Ive been pulling my hair out all week.

James

manfriday
03-21-2003, 04:21 PM
cant you use texture guide to apply UV coordinates before you export the model?

I used to do that. I would apply regular cubic mapping, or plana mapping to an object and then I would use texture guide to convert it into UV's. Then I would export it as a .x file. it worked pretty well.

Bastich
03-22-2003, 05:32 AM
I do not know very much about the workings of Lightwave so could you possibly explain how to do this.

manfriday
03-22-2003, 09:01 AM
sure.

Apply your mapping to the surface of the object, just like you have been doing.
Gte it to look the way you want it to look..

set one of your vieports to "UV Texture" so you can see your UV's.

Then, click the MAP tab at the top of lightwave.
select the TEXTURE GUIDE button, which is on the menu about halfway down.

Press n to bring up te numeric controler for the texture guide tool if it is not already up.

on the numeric controller click the ACTIONS button at the top and choose "activate"
with the drop down directly beneath it. select the surface you wish to create UV's for.
Under "Mapping" choose the mapping type you applied to this surface back in teh surface editor
check the button that says make UV's.
type a name for you UV map in the box that says UV Map and hit enter.
You should see your UV's now, in the viewport you set to UV Texture.

Now, go back to your surface editor and change the projection type for that surface to UV.
for UVMap, select the map you just created with texture guide
click use texture.
Your model should look just like it did with the old mapping type, but now it is using UV's which should export to your game properly.

One note: Using texture guide will, very often create UV coordinates beyond 0 and 1.
In your game engine you will need to set it up so that the texture will be tiled rather than stretched when deaing with UV's beyond 0 and 1.
There really isnt any way that I know of to get the UV's to all reside withint 0,1 and still look the way they should other than doing the whole UV mapping gig manually, which would suck.

hopefully that helped.
Jason

Bastich
03-23-2003, 04:02 AM
Thanks for the help its working now.

James