jPCT - a 3d engine for Java > Support

3ds max tips

<< < (3/5) > >>

paulscode:
I thought I would post this here in case anyone out there likes to use Turbo Squid Gmax modeling program, but can't figure out how to convert their .GMAX files into .3DS files for use in jPCT.

First of all, this isn't a direct way to convert to .3DS (I'll be sure to post it if I find one).  This method is a round-about way to do the conversion, but it works  :)

The first thing you need is Turbo Squid Gmax (free to use, and can be downloaded at http://www.turbosquid.com/gmax).

The second thing you need is a "Quake MD3 exporter".  There is a good one at http://www.davidhsmith.net/Essential_Tools.htm.  The one you want to download is called "Quake-3 MD3 exporter beta v1.0 - gmax".  You will want to unzip the downloaded file and copy the contents into the "plugins" subdirectory.

The last thing you need is a program called LithUnwrap.  It is free, and can be download at http://www.sharecg.com/v/5169/software-and-tools/LithUnwrap---Free-UV-Mapper-for-Windows

Now, all you have to do is create your models like you normally would in Gmax.  When you are ready, choose "Export" under the File menu.  For "Save as type", choose "Quake III (*.MD3)".  Pick a name and click "Save".

Unfortunately, this seems to only export the mesh information for you model, so next you need to load your model up in LithUnwrap (File->Model->Open).  From there, you can add your materials, textures, uv maps, etc.  When you are done, choose File->Model->Save, and for "Save as type", choose "3D Studio Files (*.3DS).

I hope someone finds this useful.  Of course you could always just buy Autodesk 3D Studio and export your models directly to .3DS.

paulscode:
I thought I would and a post this here on the sticky Max tips thread, since the question has come up a couple times recently.  These tips will get most .3ds files exported by AutoDesk 3D Studio Max to load in the proper position and orientation when using the jPCT's Loader class.

1) Set the rotation pivots for all objects in the Max scene to the origin (0,0,0).
    Click the "Select by Name" button (looks like a list with a small mouse curser).  There will be a list of all the objects in your scene.  Should look something like this:

--- Code: ---Scene Root
  --Group01
      --Mesh01
      --Mesh02
  --Geo01
  --Group 02
      --SubGroup1
           --Cube01
--- End code ---
Notice each element in your scene (not groups or subgroups).  For the above example, jPCT's Loader class would load 4 Object3Ds: Mesh01, Mesh02, Geo01, and Cube01.  Select the first one (Mesh01 in this example), and click OK.  Go to the "Hierarchy" tab (looks like one large square with three smaller squares under it, next to the "Modify" tab).  Choose the "Affect Pivot Only" button (important!).  Select the "Move" tool.  At the bottom of the window under the X,Y, and Z fields, enter the coordinates 0,0,0.  Repeat this process for each element in the scene (Mesh02, Geo01, and Cube01 in this example).

2) Make sure the views are correct for your Max scene.
    In the pannel labled "Top" make sure you are looking at the top of the model, not the bottom.  "Front" should also be looking at the front of the object, not the back.  It can be difficult sometimes to tell the difference when you are just looking at wireframes, so one thing you can do is right-click on "Perspective" in the perspective panel, and choose "Views->Front".  This will show you the front view of the rendered model, and you can rotate your model if it is wrong.  You would do the same for "Views->Top".

3) Make sure the model's center-of-mass (or whatever relative point you want the object to pivot around in jPCT) is positioned at the origin.
    Select all objects in the scene with "Edit->Select All".  In the "Heirarchy" tab, choose "Affect Object Only".  Choose the "Move" tool, and place the model where you want it in relation to the origin.

4) Recheck the rotation pivots one final time (repeat step 1)
    It is possible the rotation pivots may have shifted while you were playing with the scene's position and orientation, so check one more time to be sure.

(Export your .3ds file)

5) Perform two mesh rotations on the objects in jPCT immediately after loading.
    Use the following code on the array of Object3Ds returned by the Loader class:

--- Code: ---        for( int x = 0; x < objs.length; x++ )
        {
            objs[x].rotateX( (float) Math.PI / 2 );
            objs[x].rotateZ( (float) Math.PI );
            objs[x].rotateMesh();
            objs[x].setRotationMatrix( new Matrix() );
        }
--- End code ---

99% of the time, these steps will get your .3ds models loaded in the proper placement and rotation.  When added to the world, the model's origin will initially be positioned at (0,0,0), the "Top" of the object will be pointed "up" (-y), and the "Front" of the object will be pointed "into the screen" (+z).

raft:
instead of


--- Code: ---    objs[x].rotateX( (float) Math.PI / 2 );
    objs[x].rotateZ( (float) Math.PI );
--- End code ---

you can simply call:


--- Code: ---    objs[x].rotateX( (float) -Math.PI / 2 );
--- End code ---

r a f t ;)

paulscode:

--- Quote from: raft on March 06, 2009, 03:46:20 pm ---instead of


--- Code: ---    objs[x].rotateX( (float) Math.PI / 2 );
    objs[x].rotateZ( (float) Math.PI );
--- End code ---

you can simply call:


--- Code: ---    objs[x].rotateX( (float) -Math.PI / 2 );
--- End code ---

--- End quote ---
True, if you can think in negatives ;D  (two ways to solve every problem... the right way and Paul's way)

raft:
indeed without a negative: ;)

--- Code: ---    objs[x].rotateX( (float) Math.PI * 3 / 2 );
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version