3ds max tips

Started by raft, August 17, 2006, 02:12:22 PM

Previous topic - Next topic

raft

the problem below took me days to resolve, so i thought it may help others if it's documented in a thread.

-- o --

sometimes models arent loaded with 3dsLoader as they look in 3d max. i mean somehow their placement and rotation change when loaded into jPCT.

i first encountered this problem with the commercial village set i use in karga. the producer suggested to use XRef and it effectively solved the problem. this is done by either adding an XRef modifier to each object's stack or by using reset x-form utility in utilities panel (which indeed does the same for all selected objects)

however on some situations XRef doesnt solve the problem. the objects are still misplaced when loaded into jPCT. there seems to be a hidden translation or whatever which XRef doesnt clear, and which in turn confuses the jPCT's loader. here is the solution, it took me days to find it:

create a new object (say a box) and align its center by align tool with our object in question. convert the new object to editable mesh (or poly) and attach our object to it. now go to element sub object level, select new object and delete it. your object has now a brand new transform.

this is the document i found this workaround in: http://fosters.realmwarsgame.com/maxdts/section2.html

note: maybe you may wish to add to this thread in time to build a list of helpful 3d max tips. Egon, maybe you may wish to open a new forum category for this purpose

hope this helps
r a f t

EgonOlsen

Good to see that you've finally solved it. Maybe we should make this thread sticky and rename it to something like "3ds max tips" or similar. What do you think?

raft

sure, i'll be glad indeed :)

EgonOlsen

Done! So if anyone has anything to contribute regarding 3ds (or finds something in the forum that would fit in here): This is the place to post it.

san14

I would like to know. The way you load .3ds object in JPCTDemo.java Is it possible to load .max file in similar way. If so could you help me with some example.
San14

EgonOlsen

#5
No! Max is a proprietary format for which you have to get a license to be allowed to read/write it. You've to export these files as 3ds or obj to load them

ToddMcF2002

Does anyone know how to get faces to share a UV in max?  For example the back side of a house should have the same texture as the front?  I've seen a bunch of UV Unwraps that show just unique faces in the UV but I'm not sure how to do it.




raft

add an UnwrapUV modifier to the stack. among other properties of modifier there is an edit button which lets you modify UV coordinates precisely

ToddMcF2002

Maybe I wasnt clear in the question.  I'm in the Unwrap already, moving stuff around.  But I finally realized the answer.  If two unwrap faces are the same size and are supposed to share the same texture you just move them on top of each other so they have the same coordinates.  It seems so obvious now jeesh.


Melssj5

Another thing.

on 3d studio MAX, when a texture is applied directly to an object without using UVW maps, then by default it is applied on UV direction, this can be changed from the 3d studio max to be uv, vw, uw. But once this is done, jpct doesnt recognize this parameters, it recognizes when some modifiers of texture coordinates are applied, not the simple way.
Nada por ahora

paulscode

#10
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:
Scene Root
  --Group01
      --Mesh01
      --Mesh02
  --Geo01
  --Group 02
      --SubGroup1
           --Cube01

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:
        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() );
        }


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

    objs[x].rotateX( (float) Math.PI / 2 );
    objs[x].rotateZ( (float) Math.PI );


you can simply call:

    objs[x].rotateX( (float) -Math.PI / 2 );

r a f t ;)

paulscode

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

    objs[x].rotateX( (float) Math.PI / 2 );
    objs[x].rotateZ( (float) Math.PI );


you can simply call:

    objs[x].rotateX( (float) -Math.PI / 2 );
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: ;)
    objs[x].rotateX( (float) Math.PI * 3 / 2 );