Map in OBJ ?

You think of something which could be added to TA3D post here! /
Vous pensez à quelque chose que l'on pourrait ajouter à TA3D, postez ici!
Post Reply
Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Map in OBJ ?

Post by Durand » Wed Feb 02, 2011 4:35 pm

Do you think it's possible for TA3D to use it's poly engine for use OBJ maps ?

I don't know if maps made in 3D modelers can be good, but at least it can be a neat possibility to have maps without waiting for a map creation software. And common 3D modelers are always simpler to use for unit modelers.

I though of that today and, reflexion made, if the game allow it, i don't see what can stop an OBJ + FBI-like file to present some map : We can add directly in the 3D-modeler not only the ground, box with ID (reported in the fbi-like file) for stuff, metal patchs, units, starting pos, etc.

If that's technically possible, i can make a map like that as example of what i have in head.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: Map in OBJ ?

Post by zuzuf » Wed Feb 02, 2011 5:23 pm

That's an interesting idea. Currently TA3D won't open an OBJ file as a map and still requires a grid structure for the map (it uses a height map internally) but if one can generate the height map from geometry (actually you just need to render it into a buffer and keep the depth buffer) the it would be possible to make it work. Map objects can be put into an .ota file (several campaign missions use it to change a few things with the difficulty level). Given the size of the geometry expected to have a nice map, it would probably requires a dedicated renderer (for fast clipping of non visible geometry). It'll also require big textures. How do you want to play with textures?
=>;-D Penguin Powered

Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Re: Map in OBJ ?

Post by Durand » Thu Feb 03, 2011 6:07 am

Oh, i though the game could generate itself a heightmap with the geometry.

If not, i found that in a board for the game Ogre :
1. Create your terrain in maya

2. Create a gradient texture in photoshop that goes from white on top to black on the bottom

3. In maya's hypershader create a 2d texture with the "As Projection" radio button checked. Double click the projection node to bring up its attributes. Click the tab that says file# (where # is an actual number). Assign the gradient picture you made to the image field.

4. Assign the texture to a material (I used lambert) by middle clicking and dragging the texture onto the material and choosing default from the drop down box.

5. Click on your terrain. With the terrain selected right click on the material you created and select "Assign Material To Selection"

6. In the perspective window, hold down the space bar and select "edit polygons"->texture->planar mapping square. Set the projection to be in the x direction.

7. Set the render settings to render from the top view. Go to the top view and zoom in on your terrain so that it takes up the whole screen. Render the image and save the texture.

8. Voilla! although I am sure you didn't get to this point because tutorials always leave out some key step and for that I apologize in advance.

The quality of the heightmap that I was able to produce is pretty crappy. My hope is that I will be able to refine the technique and get a better heightmap.

I know a lot of people were probably frustrated that ogre used these cool heightmaps to generate terrain but they were unable to generate the heightmaps from existing geometry. Let me know if this helps anyone.
I can try that.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: Map in OBJ ?

Post by zuzuf » Thu Feb 03, 2011 3:24 pm

Making the height map from the geometry is easy, it's just a matter of rendering the geometry (OpenGL will produce a depth buffer which will be our height map). It's just not done yet. Could you send me an example of map created that way (I need something to test the code I'll write) ?
=>;-D Penguin Powered

Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Re: Map in OBJ ?

Post by Durand » Fri Feb 04, 2011 4:22 am

Okay, i make a map today.

Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Re: Map in OBJ ?

Post by Durand » Sun Feb 06, 2011 1:10 pm

Damn, that was way harder than i though. 3D modellers are not made for terrain mapping...

But here's a map. Without the texture for size.
Attachments
carte.zip
(162.54 KiB) Downloaded 463 times

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: Map in OBJ ?

Post by zuzuf » Sun Feb 06, 2011 1:33 pm

Hm, it looks like it's not an OBJ file. The file command reports me its a maya binary file but I cannot open it :|
=>;-D Penguin Powered

MattyWS
Posts: 146
Joined: Sat Jan 23, 2010 12:46 pm

Re: Map in OBJ ?

Post by MattyWS » Sun Feb 06, 2011 1:46 pm

very blocky, should you want to make anything in the future i'd recommend modelling it properly instead of using a flat plain and rasing the squares. Not that theres anything wrong with it as a test map. Seems maya doesn't export to obj though, so I cannot export it for you, I do not know what will happen to the content in the file if i export it to another format to open in 3ds max to export to obj, so i'll leave it to you to do. :)

EDIT on second thought, i'll give it a go
Attachments
map thingy.zip
(103.45 KiB) Downloaded 472 times

Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Re: Map in OBJ ?

Post by Durand » Sun Feb 06, 2011 2:21 pm

Woops, sorry. Here's an OBJ version.

Yes, yes, Maya export in OBJ (like nearly all modern 3D modelers i know). But you have to activate the export plugin in the plugin manager (somewhere in the setting tab). Of course, i have a Maya from 3 years ago...
Attachments
carte2.zip
(113.38 KiB) Downloaded 457 times

MattyWS
Posts: 146
Joined: Sat Jan 23, 2010 12:46 pm

Re: Map in OBJ ?

Post by MattyWS » Sun Feb 06, 2011 2:32 pm

ah lol, i have maya 2010 but I prefer 3ds max (i have the whole 2010 autodesk suite)

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: Map in OBJ ?

Post by zuzuf » Sun Feb 06, 2011 2:36 pm

What are those startbox objects ?
=>;-D Penguin Powered

Durand
Posts: 74
Joined: Thu Nov 04, 2010 11:13 am

Re: Map in OBJ ?

Post by Durand » Sun Feb 06, 2011 3:34 pm

An idea i had : Players don't start in start positions, but choose their place in the start box. Something half way between normal start positions and the free starting boxes in Spring. Let the player a little more liberty for choosing their position at start without breaking the idea of the map designer.

Of course, null if not implemented :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests