Ogreode static objects

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Ogreode static objects

Post by charlie »

I want to create a static object in my world but it has not the shape of a sphere, box, ... Because until now when I wanted to create a static ogreode object i always used MeshInformer::createStaticBox(..) . Now my Object half rounded, but not a sphere, well hard to descripe. What is the easiest way to get a physical representation of this mesh in the ogreode world?
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Now my Object half rounded, but not a sphere, well hard to descripe.
A picture's worth a thousand words...

Either approximate your shape with a collection of the supported primitives, offset with Transform geometries (like the helicopter demo) or use a Trimesh.
User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie »

I tried the createTriangleMesh(..) . This didn't work very well, since the buggy (the mesh should be a jump) got stuck in it. My object should be a simple round jump. (well, I'm new to modelling, too)

I already looked through the helicopter example, but I don't think that method can be applied here.

Here's a picture that shows the problem:

Image
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Err, OK. The Triangle mesh stuff should work, does it work in the main test demo thing, the one that looks like a little chunk of landscape?

I'm assuming that the white box around your jump is Ogre's bounding box, can you turn on the debugging geometry to see what OgreOde's building for your jump geometry? Just call setShowDebugObjects(true) on your world.

And actually, you could use multiple transformed geometries for your jump, just use a load of long thin boxes, 5 or so judging by your picture, translated and rotated so that the top faces of them coincide with the surfaces on your jump. It'd be a PITA to work out the transformations though!
;)
User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie »

The Triangle mesh stuff should work, does it work in the main test demo thing, the one that looks like a little chunk of landscape?
yes, works fine
the white box around your jump is Ogre's bounding box
yep
Just call setShowDebugObjects(true) on your world.
Here's the new picture:

Image
you could use multiple transformed geometries for your jump, just use a load of long thin boxes, 5 or so judging by your picture, translated and rotated so that the top faces of them coincide with the surfaces on your jump.
I also had this idea (and that's also what I did) but I thought that there might be a nicer way, since I have this problem not only once...

Although the new picture looks quit good, with the blue triangles. But, the car still get's stuck...
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

A wild stab in the dark, but do you have culling switched off on that ramp mesh? It only seems to be one polygon thick and I can see the "back" of the ramp, even though I'm looking at it's back-face.

If you turn culling on then you might find that the mesh disappears, because you've got the normals pointing the wrong way. This will mess up the tri-collider because it thinks you're driving on the inside of the mesh. So flip your normals in your modeler before you export it.

The triangle mesh collider definitely works, because I'm using it extensively in the new GranTurismOgre demo.
User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie »

It only seems to be one polygon thick
That's right. I simply took an elipse and used the "extrude" in ac3d
If you turn culling on
Since I now know what culling is (thanks wikipedia ;) )
But the api has so many hits on culling that I'm not sure how to switch it on. Could you give me a hint because this seems to be really helpful for debugging things like this?

Thanks for you help...

But I'm not only new to ogre (and 3d programming) but also to modelling. (but I suppose that got clear because of my questions ;) )
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

In the material it'll say something like "cull_hardware off" and "cull_software off", just delete those lines. Or set the surface to 1 sided in ac3d, then you'll see it looks wrong, so just flip the normals.
User avatar
charlie
Greenskin
Posts: 146
Joined: Mon Nov 15, 2004 1:43 pm
Location: Austria
Contact:

Post by charlie »

Thanks a lot!!

Worked
Post Reply