3DS Map Troubles

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.
Post Reply
davidjohnharrison
Posts: 7
Joined: Wed Nov 09, 2005 5:43 pm

3DS Map Troubles

Post by davidjohnharrison »

Hi

First of all, I would like to say that I am extremely new to Irrlicht, so sorry if this question is really stupid.

As a test, I tried to change the map loaded by the Collision example that comes with Irrlicht to a .3DS file to use instead. The 3DS map is a proper map and the player IS in the right position, not outside it.

However, the camera just falls straight through it, into infinity.

I have searched, and cannot find a tutorial on how get the camera to collide with the new map properly, so I was wondering if anybody would be able to help me.

Thank You

-David-

EDIT: Sorry, I forgot to say that I did this by just changing the name of the .PK3 file loaded, so that it loads a .3DS instead. I have tried to find out other ways of loading a model to see if I need to change any more of the code (which I probably do) such as the model loading function or collision type, but so far everyone who I have asked has been unhelpful (not in this forum, of course :D )
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

There isn't anything different to do code-wise.
Once a mesh is loaded into Irrlihct, regardless of the mesh format, it is all handled the same way.

A couple of things come to mind:

1. It may be a proper map as seen in your modelling app, but it could get goofed up when loaded into Irrlicht.
Try this: Load your *.3ds file with the MeshViewer that comes with Irrlicht and make sure that everything is correct, such as the normals facing the right way

2. Double check your code with the collision tutorial (unless you just used that code and swapped out the file)

and 3...
There is an ellipsoid around the camera node that defines how close you can get to an object before a collision happens. If it is too big, and you camera is placed too close the floor of your map - in such a way that the ellipsoind cuts through the floor, then you may fall right through it.

If 1. and 2. doesn't seem to help, then translate your camera up a bit, or shrink your ellipsoid a bit.

If I recall correctly, there is a notation in the tutorial that tells you which parameters will adjust this.

Good luck.
Join us in the Irrlicht chatroom:
[url]irc://irc.freenode.net/irrlicht[/url]

I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
davidjohnharrison
Posts: 7
Joined: Wed Nov 09, 2005 5:43 pm

Post by davidjohnharrison »

Thanks for the help :D

I tried loading the model into the mesh viewer, and it loaded fine. All of the normals are facing the right way and everything. All I did was substitute the file, so there shouldn't be anything wrong with the code. I tried moving the camera up, but it still just fell through :(

It is more of a platform than an actual level, but in theory it should still work. However, it is not triangulated. Does it need to be? If it helps, I am using Anim8or.

Thanks again.

-David-
EDIT: nvm, solved it! :D
I feel like a right idiot, but by plaing around with the code, I found out that the mesh wasn't actually as wide as I thought it was, so the camera wasn't actually touching it :oops:

I moved it across, and collisions work perfectly.

Sorry! :D And thanks for the help :D
Post Reply