About Store Forum Documentation Contact
Donations:
178$/mo



Post Reply 
Export world as obj mesh
Author Message
b1s Offline
Member

Post: #1
Export world as obj mesh
Would be really awesome and usefull to be able to export the whole .world file as one single mesh.

This would deffienetly help us in the long run.
Maybe create an obj from terrain and then add as parts all the rest to that and then export that as a whole .obj file.

This would really help to create some certain props that needs the terrain mesh and some other meshes....
06-23-2011 12:51 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Export world as obj mesh
ExportObj(EE::mesh)

retrieving terrain meshes and add it to meshbase is already possible.
06-23-2011 03:08 PM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #3
RE: Export world as obj mesh
Code:
if(Kb.bp(KB_X))
   {
       Mesh mesh_temp;

       for(int x_pos = -100; x_pos<=100; x_pos++)
       {
            for(int z_pos = -100; z_pos<=100; z_pos++)
            {
                if (Game::Area *area = Game::World.areaActive(VecI2(x_pos, z_pos)))
                {
                    tile_counter +=1;

                    mesh_temp.add(area->data()->mshg.meshes(0));
                }
            }
       }
       mesh_temp.save("area.mesh");
   }

Next -> EE Converter - > convert to *.obj

I used this simple loop when i needed whole heightmap in 3dstudio max (i was making asphalt roads meshes).

Try scan containers and add whatever you want.

This is screenshot from BM heightmap in 3dsmax
[Image: beztytuuziu.jpg]
(This post was last modified: 07-27-2011 10:22 PM by Mardok.)
07-18-2011 07:40 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #4
RE: Export world as obj mesh
Thanks this was very usefull.
07-22-2011 12:35 PM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #5
RE: Export world as obj mesh
Hi,

Before last update my code worked fine, now i have this error:

error C2440: 'initializing' : cannot convert from 'EE::Game::Area *' to 'EE::Grid<TYPE> *'

(07-18-2011 07:40 PM)Mardok Wrote:  
Code:
if(Grid<Game::Area> *grid=Game::World.areaActive( VecI2(x_pos, z_pos )))
{
     Game::Area &area=(*grid)();
    
     ...
I saw changes:
----------------------------------------------
-simplified grid.h header
-new member Grids::user
-classes used for Grid (such as Areas) now need to have changed constructor parameters from (C VecI2 &xy) to (C VecI2 &xy, Ptr grids_user)
-'Ptr grids_user' passed to Game::Area, Edit::Area, Net::Area constructors now points to the World object containing the area

----------------------------------------------

But i can't do this properly. Could someone explain how it should look? Without errors...

I need this tonight ^^ smile
07-24-2011 04:24 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: Export world as obj mesh
No need to use Grid anymore. Just simply:

Code:
if (Game::Area *area = Game::World.areaActive(VecI2(x, y)))
07-24-2011 07:36 PM
Find all posts by this user Quote this message in a reply
Post Reply