Archived

This topic is now archived and is closed to further replies.

hundel

Characters That Hold Things

Recommended Posts

I'm having trouble with characters that carry simple objects and I wanted to get some feedback. My toolkit is 3ds Max. I'm exporting a static (unanimated) 3DS mesh from each frame and converting them to a collection of X files, which animated in succession produce the frameset. With me to this point? Now, let's say I want to get a bunch of X files of a character swinging around a sword or something. In this case, I'm actually outputting the character and object in a single 3DS file. My relative coordinates are somehow getting thrown off in the exported files. Everything renders just fine in 3DS. This seems pretty simple. So what am I doing wrong and how should I be doing this? [edited by - hundel on May 6, 2003 12:18:11 PM]

Share this post


Link to post
Share on other sites
I''ve asked this about a year ago - never got any help. Help me out guys, you wouldn''t believe how far out my workarounds for this have been over the last year. Believe me, any advice I get will be "payed forward" in forums where I do know some answers...

Share this post


Link to post
Share on other sites
If I pull the X files from my own DirectX engine and place it in the MS sample X file renderer, Quick3D, or any other X file renderer, the object floats away from the character.

Guessing this should be resolved from the 3DS Max side. In other words, when I export two objects together in one file, their relative coordinates seem to get messed up because I am very informal in my knowledge of 3DS Max and probably have not followed a tight procedure for object pivot centers, etc before merging them into a scene or exporting them together to a file.

Any ideas? What's your procedure for merging two objects into a file? Do they always export as they look on the screen, or do they separate strangely if you don't have their relative centers normalized or something?

[edited by - hundel on May 9, 2003 11:32:12 AM]

[edited by - hundel on May 9, 2003 11:32:54 AM]

Share this post


Link to post
Share on other sites
well, if the object, like a sword or weapon, is always going to be held, why not make it one model instead of two?
--or--
if the objects are not always held, or can be changed, try exporting them in separate files and see what happens.

Share this post


Link to post
Share on other sites
Yeah - thanks. Those are actually my current workarounds! The only problem is I''ve been doing that for a year now. It has made it a bit more time consuming to swap objects and reexport everything, etc.

I know I must be doing something simple wrong. One thing I''d like to do is export a couple of dummy objects and play around with them until I can reproduce the problem.

Share this post


Link to post
Share on other sites
I have a very strong feeling that this is a programming problem, not a "visual arts" problem. Mostly because this sort of thing has to do with how the engine you use works with weapon models (for example).
For instance, in HalfLife (IIRC), they simply have a bone that''s not attached to anything, but which is used to align the position of the gun. The gun is attached to the bone by the game, as the need arise.
I would venture that you simply create a bone in your weapon to be held of some standard size. Then in your player model, you must include the same sized bone where you want the weapon to be held. Then simply align the two models using the identical bones... does that make sense ? Otherwise go and ask in the graphic programming or the DirectX forum.
Hope it helps !


Sancte Isidore ora pro nobis !

Share this post


Link to post
Share on other sites
Thanks ahw.

Wouldn''t it be odd if the sample X file renderer Microsoft ships with DX would have the same bug with bones? All I''m doing is rendering the contents of the X file (no bones about it).

The X file renders the same in my engine as in the DX sample code. I could probably try it out in OpenGL, but I''m guessing the coordinates in the export file is the problem if it renders the same in my code, DX sample code, Quick3D, etc, isn''t it?

I''m glad I''m getting feedback though - thanks and keep it coming. I''ll have more info for you when I get a few minutes to play around with just merging and exporting some test cubes with their own local coordinates and what not...

Share this post


Link to post
Share on other sites
I''m not sure I can be any help at all here, but in Blender there''s the ability to Parent an object to another object so that if the Parent moves the Child moves with it. No idea how that is done in 3DS.

Share this post


Link to post
Share on other sites
Thanks TechnoHydra. I used a link in 3DS Max.

Noticed that if I go into the IK of the carried object, select pivot, and move its relative center, this effects the position its vertices export to. I could tweak the relative center until the object lined up, but there''s just too much trial and error involved!

If anyone has a standard practice for merging two source files in 3DS Max, exporting as a single 3DS file, and getting the conv to an X file to land the objects in their correct relative positions, please post. I''m sure it''s my non-standard (self-taught) ways that are to blame.

Share this post


Link to post
Share on other sites
quote:
Original post by TechnoHydra
I''m not sure I can be any help at all here, but in Blender there''s the ability to Parent an object to another object so that if the Parent moves the Child moves with it. No idea how that is done in 3DS.


That''s pretty much how it works for any program that allows you to use skeleton. Without this concept you cant do FK or IK, for a start.
But like I said, I think his problem is a programming problem, not a software one.
You *should* ask in another forum, I am sure you would have more answers.


Sancte Isidore ora pro nobis !

Share this post


Link to post
Share on other sites
Just put them in seperate files, put the sword center at 0,0,0. Then in code, move the sword to the position of the hand AFTER you''ve moved your object around and stuff. This would make the sword in the proper location no matter which weapon or position the player is. Once you add in animation support, you will basically just apply the transforms on the hand that is holding it to the sword, that way it ends up in the same orientation as the hand does.

Share this post


Link to post
Share on other sites
Ready4Dis - that works fine. I only have problems when I want to combine two 3DS files and output them to a single file.

ahw - Yeah, thanks again. I suppose it could be a software issue, but in my business life I''m just not that used to seeing a software bug show up in two totally different codebases. The common factor here has got to be the source data - the way I merged the files, their relative coordinates and the absolute coordinates the vertices take relative to one another when I export to a 3DS file.

I''m going to go figure this out with basic primitives right now and I''ll post you guys if I know something.

Thanks again!

Share this post


Link to post
Share on other sites
It can be reproduced with 3rd party software and basic primitives. Here are the steps:

1) Download nuetral 3rd party freeware to test render such as Quick3D (to rule out software bugs).
2) In 3DS Max, create a standard primitive cube. Just click create primitive box and drag the mouse in one of the viewports. Save the file as box1.max
3) In 3DS Max, create a second cube using drag-and-drop. Make it roughly the same size as the first. Save as box2.max.
4) In 3DS Max, start a new scene, choose file-merge. Select box1.max''s cube. Repeat, merging box2.max''s cube.
5) Select both cubes and choose "export selected" as a 3DS file - box.3ds.
6) Open box.3ds in your nuetral 3rd party renderer. Note that the boxes do not line up exactly as they did in 3DS Max.
7) In 3DS Max select one cube, go to the IK tab and select pivot. Select the "pivot only" toggle button. Note the pivot position may not be in the object''s center. This probabgly accounts for the oddly exported local coordinates. Move the pivot point and re-export. Open the new file, and notice that the object has moved (perhaps drammatically, depending on your scale).

Share this post


Link to post
Share on other sites