Help with 3D Models!

Previous topic - Next topic

FutureCow

Hi All!
This is for my competition entry so I'll understand if offers for help go strangely quiet   =D

I'm having serious trouble with my ship models for the game (Battleship). I've designed my models and they look fine in my model application (Doga - i.e. 3D for dummies!  :-[) Trying to convert them for GLBasic though is driving me nuts!!!

No matter which application I use -  Doga, Metasequoia, Deleg3D, Anim8or, Wings3D, Blender (and note, I don't know what I'm doing with just about all of these!) I cannot get a UV texture map that doesn't overlap all over the place for my models - and I can't work out how to fix it. All I'm trying to do is colour my model and have all the lines of the model showing.

So if you're an expert in [insert 3D modelling application of your choice here], know how to turn not very complex (<2000 polygons at a guess?) models into useful uv texture files that I can draw all over, and are happy to lend what will hopefully be just a small amount of your time to get your name in my game's credits - please let me know!

I'll update this post when I get home with a link to the models mine are based on so you can see how complex they are.

Kitty Hello

do make sure that the texture is power of 2 in size. Some modelling programs will use the value 1.0 as the bitmap size instead of texture size, otherwise. It's really stupid.

If it's not working, still, send me an email.

FutureCow

I'll try that. It's probably more a problem with my use of the 3D programs than GLBasic.
If anyone wants to create the UV map for me, my models are based on these
http://www.sharecg.com/v/30932/3D-Model/Ships-for-use-in-DoGA?division_id=11

Hemlos

Anim8or v95 and v97 has a huge difference in the way the 2 programs map an object.

With 95 you can alter the dimensions of the uv using CTRL, shift buttons and your mouse buttons. Each of these alter the way the uv moves differently in v95.

With 97, it is more limited, however has pretty cool sphere mapping.
Aside from spheres, in v97 you can select a face, then alter just that face if you need to.
Doing the single faces is tricky, and takes practice as to not mess up the whole map.
Use multiple object copies in object mode to get it right....and make sure you use a large buffer of memory for undo.

And so important, that you must use a bmp of the proper dimensions....if you dont, then youll get trash in the game. As Gernot mentioned, use any power of 2 for the dimensions....ie, 2 4 16 32 64 128 512 1024 etc
Bing ChatGpt is pretty smart :O

FutureCow

Thanks Hemlos, I'll see how I go.

FutureCow

#5
Do materials from a 3D object get brought across into the .ddd format? I've created my models and assigned materials (flat colours) to various parts of them. I've then tried to draw them in my program (after a .obj->.ddd conversion) and with a -1 texture they're just grey.
Assuming the materials don't port across, is the only way to colour-in a 3D object to do a UV texture on it and display with x_settexture?

If I have to do a UV map, how do I get it to the right size? The programs I've looked at don't export square textures (eg. 256x256 / 512x512) as suggested I should use. If I resize the bitmap produced to make it a power of 2 then my U/V data will be wrong.

And what happens if I UV map with a planar split (ie. where my uv map shows me just the left and right views) - what happens to the triangles that can only be seen on the top or bottom views? What do their uv values get set to?

Trying to get 3D working is driving me NUTS!!!!!!!!!!!!  HELP ANYONE?!?!?!?! :giveup:

Hemlos

All modelling prograsms pretty much do the same thing.
....you shape it, color it, texture map it.
A uv map, is simply placing coordinate numerals on a vertice, these are the position of the material which you will use.
No texture information is saved other than the coordinates....this is where you are skinning and detailing the model.
In order to see the proper texture on the model, you must load the texture and apply it to the model during rendering in your program.


To load a texture into anim8or:
1. click options
2. click materials.
3. double click the material square named "New"
4. click the button next to "Diffuse 0.700", it has a - sign in middle of the button.
5. click "load texture"...use a square power of 2 dimensioned texture.
6. apply.

Now you have a proper dimensioned texture to apply to a UV map.

Next....select the model, then click UV, then click save.

At this point you have a model looking exactly how it should in GLBasic.
In GLBasic, You must use X_SETTEXTURE and call the file which you loaded with LOADSPRITE.


Bing ChatGpt is pretty smart :O

FutureCow

Is there any way (with any freeware program) to export a UV file that's pre-textured with the materials you've assigned to the object? With the instructions you've given i'll have to re-colour my model all over again but with textures instead of materials.

FutureCow

Can someone please try to load this one? I can't get it to work.
It textures properly in anim8or, but the texture's all over the shop when loaded in GLBasic.


[attachment deleted by admin]

Hemlos

Quote from: FutureCow on 2009-Dec-30
Is there any way (with any freeware program) to export a UV file that's pre-textured with the materials you've assigned to the object? With the instructions you've given i'll have to re-colour my model all over again but with textures instead of materials.

Let me try to help you understand how 3d works.
GLBasic uses only one texture, and one texture coordinate system.

In 3d creation programs(anim8or, maya, wavefront, 3dstudio), these programs allow you to create a material list ( list of multiple .bmp textures, with identifiers ) . You can program your game to read the material files...but this is not needed, simply enough because glbasic only uses one image for an object.

A UV is like saying XY, it is a coordinate system, which these coordinate numbers are stored in each 3d vertex. It tells your program which part of an image to show on a 3d triangle. This is part of the reason why you ust use the same image in the 3d program as your game, so you know where the image is being mapped.

In a 3d program, you can also change the color of each vertex, and these colors are stored in the each of the 3d vertices. So coloring, and texturing, are not the same thing.

When you select a material in a 3d program, make sure it is 2x2 power and you can only use one single texture. Saying this, you will need to build a texture with all the detailing, and move the texture around on your object in order to see it render properly.

I will download your model, and review how it was created, i will be back soon to let you know what changes are needed.

Bing ChatGpt is pretty smart :O

Hemlos

#10
I checked your model in glbasic program, it seems the model isnt correctly UV mapped.
If you send me the .an8 file, i can check into what the problem is.

Did you export it as .3ds?

Oh and what version of anim8or are you using to uv map the model?
Bing ChatGpt is pretty smart :O

Kitty Hello

The UV coords are flipped upside down.


What did you use to convert it?
Please attach the original object.

FutureCow

#12
Thanks for the help guys!
The models were modifications of free ones (SUF format - used by the DOGA 3D program). I used Metasequoia to produce the .obj file from the .suf file. The .obj file loaded fine in DeleD, anim8or, Blender, Wings3D and all the unwrapping programs I've tried.
From here I used Lithunwrap to unwrap the model (I tried using other program's UV mappers, but after trying a few of them I found this was the easiest to use - and it's also one of the few programs I found that I can easily work out how to use to produce a bmp file that's a power of 2.  I did try the free uvmapper program too which was good, but it's bmps weren't a power of 2.
link : http://www.sharecg.com/v/5169/Software-and-Tools/LithUnwrap---Free-UV-Mapper-for-Windows

Hemlos, I tried anim8or but couldn't figure out how to make it produce the bmp file of the UV data - all I could find was the UV button which drew a yellow box around my model - that was as far as I could work out so I gave up after that.

It resaved the model with the new UV coordinates in lithunwrap (it's got a good feature where I can select triangles based on the materials in the original object. As I'd already allocated materials based on the objects in the model (ie. I had a "gun" material, and a "ships hull" material etc) it was easy to produce a good UV map bmp. I've just checked it, and at the save point (for both the bmp and model files) it doesn't have a flip UV coordinates vertically option. I'm not sure why they're upside down - possibly a bug in the program?

Funny that the coordinates are upside down though, as I can load the .obj model with that texture file in anim8or without having to do anything special.
So I'm not sure where I went wrong, but thanks for working out that the UV coordinates are upside down Gernot!!!! Maybe I'll just flip my bmp file in Paint Shop as the easiest solution.
I've attached the original .obj file. It's not ideal (ie. it has both front and back face triangles as I was having earlier trouble with parts of my model disappearing - I'm not sure why so that was the easiest fix) but it works.

[attachment deleted by admin]

Hemlos

#13
QuoteHemlos, I tried anim8or but couldn't figure out how to make it produce the bmp file of the UV data - all I could find was the UV button which drew a yellow box around my model - that was as far as I could work out so I gave up after that.

Anim8or:
Correct, it will not create a map.
The uv tool is used to move, or twist, on the object texture coordinates.
Personally i prefer this method because it is fastest.

Lithu:
The solution you came up with to "unwrap" and create a map is pretty handy too...youll spend a little more time in 2d editors tho.

3dconverter:
Convert3d .obj doesnt seem to import objects very well...i get mixed results depending on complexity.
I always get good results with importing a 3ds file, try exporting your objects as .3ds.

Disapearing faces:
You were having problems with disappearing faces, because of the transparency colors being mapped onto the faces.
You should try to fix this without using backside maps...as it will increase your GPU performance to cull for only front faces to show.
If it was correct in your 3d editor, then the problem might be in the import/export functions.
Try using .3ds to solve this issue.




Bing ChatGpt is pretty smart :O

FutureCow

Thanks Hemlos, I'll try .3ds instead.