3DS models hotspots

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
BRPAZ

3DS models hotspots

Post by BRPAZ »

I'm having trouble using some 3DS models. They load OK, but they're all in the wrong positions.

e.g. click to download 3ds file. When I load this into the 3rd person camera tutorial

Code: Select all

mesh = smgr->getMesh("omega.3ds");
p1 = smgr->addAnimatedMeshSceneNode(mesh);
p1->setPosition(core::vector3df(0,0,0));
scene::ISceneNode* p1_target = smgr->addEmptySceneNode(p1);
p1_target->setPosition(core::vector3df(1,0,0));
It's not in the middle of the screen, like some of the other models I've tried...

What's wrong here?

(I'm completely new to this, so it may be an easy solution... :lol: )

Thanks!
RizzleR
Posts: 15
Joined: Tue Jun 15, 2004 10:12 am

Post by RizzleR »

maybe try scaling it ,

p1->setScale(vector3df(0.5,0.5,0.5)

or check the origin of the model
that gave me some problems a few times

or something like that
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

I downloaded your model and tried opening it in different modeling packages that supported 3ds. For my surprise, it appears all torn appart in 3dsmax, gmax, unwrap3d, milkshape3d and characterfx, but my surprise was even bigger when I loaded it into AC3d and loaded up perfectly. To be honest, before opening it in AC3d I thought it was a water tank, only then I saw the nice bot you modeled. From AC3d I exported it as an .x file, opened it with DX mview and re-saved it to .x

I definitely think it's incompatibilities in the 3ds file format. Try .x which seems to be the most optimised file format for Irrlicht.

If you need the .x version I converted, you may get it here:
http://www.theshower.nl/cgi-bin/genesis ... /omega.zip

try this one out and let me know. The code to load it is exactly the same as with 3ds files, just change the extension.

cheers
Image
BRPAZ

Sorry for the late reply

Post by BRPAZ »

OK, I loaded it up into the engine. It's now on the floor atleast, but it's not infron of the camera, it's on the right corner of the screen..

I have absolutely no idea how to fix this, or what's wrong. Could you help?

Thanks
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post by dingo »

screen shot?
-= Want your C code to control real life robots? www.users.on.net/~symes =-
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Yeah, I would like an explanation too how you can put models in the right place (x,y,z, where do they start ?)
BRPAZ

Scrnshot

Post by BRPAZ »

Image

Yeah, that thing on the right is the bot... :lol:
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

The vector position you give the node to start/move to is the origin (0,0,0) that the model is relative to in your modelling program.
brpaz

Post by brpaz »

Oh, so (0,0,0) is not the centre for the model in my modelling app?

If so, how can I fix this in e.g. AC3D ( I just downloaded, and it's good cuz it can import/export various types)?

Thanks
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

brpaz, in your modeling application there will be a "center" of any object. This may not be what you, me or anyone else thinks as the center of the object. It is usually called the pivot point(3DS Max) and should be able to be adjusted. I do nto know how to use AC3D but in Max you can move this pivot point.

Now that does not mean that the model will still be at 0,0,0 when you load it in Irrlicht. In the modeling application you still much set your model to 0,0,0. NOTE: this location is from the pivot point not nessecarly what is thought of as the center of the model(it could be far far from it).

Hope that helps
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post by MasterD »

Be aware of this pivot point!

Irrlicht Version of February didn't use these and I don't know for sure, if it uses them by now. So, take care when modifing Pivot Points, they can mess your model up in Irrlicht.

But I hope, that these will be recognized in future versions of Irrlicht :D , if they are not supported by now, since they help modeling IMHO.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Or you could just move your model to be in the centre of the origin. 0,0,0 is loaded as whatever point you move the model to and every position in MAX is relative to the point that the model is on. I heard somewhere that modelling in the -ve is bad form but never seen an explination as to why this is so it's probably an old wives tale :)
BRPAZ

Post by BRPAZ »

Ah, OK. I have a copy of MAX around, so I'll install it (haven't used it much, been using Maya).

I'll see what happens.

Thanks
BRPAZ

Post by BRPAZ »

OK, I've loaded up the model in 3DS 6.

Image

However, it seems to be in the centre of the workarea in this pic. But ingame, it's like this:

Image

What's wrong..?

(He's standing in the air...)
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Scale it down?
Post Reply