a problem of loading mesh that works fine with Ogre

anear

28-06-2006 13:13:15

Just manage to setup everything and play around with tutorials. I tried to change Tuturial102 to load my spherical orange object which works fine in Ogre. I created it in 3ds Max and exported to .mesh. It's just a simple sphere, uv mapped, and textured.


myCube = mScene->createBody("myCube","cube.1m.mesh",
new cubeShape(1),10.0f,Vector3(0,6,0));
mySphere = mScene->createBody("myOrange","orange.50cm.mesh",
new sphereShape(0.5f),10.0f,Vector3(3,3.5,0));


Only the cube shows, no orange at all. I've copied the orange.50cm.mesh, the material script and the image to corresponding media directories.

Help?

ColeZero

28-06-2006 13:40:31

Take a look into the Ogre.log, maybe it can't be loaded or something.
Or is it there, but its too small?

betajaen

28-06-2006 13:43:02

Hmmm...If it couldn't load it it would crash.

If you go into debug mode, can you see the outlines of the orange then?

The other two reasons I can think of is that the normals are facing the wrong way, or the sphere is really really offset from the centre.

anear

28-06-2006 14:18:22

Yes, I can see the outline of orange in debug mode, and the physics of the orange works fine in debug mode (I can push it around to bump with other bodies). It seems rendering problem. What's wrong do you think?

material script is simple as this:
material orange
{
technique
{
pass
{
texture_unit
{
texture OrangeTex.jpg
scale 1 1
}
}
}
}


Ogre.log looks fine.

13:57:18: [NxOgre] NxOgre Log started.
13:57:18: [NxOgre] Starting up PhysX SDK
13:57:18: [NxOgre] Started.
13:57:18: [NxOgre] Creating scene 'Main'.
13:57:18: Mesh: Loading sphere.50cm.mesh.
13:57:18: Mesh: Loading cube.1m.mesh.
13:57:18: Mesh: Loading orange.5m.mesh.
13:57:18: Texture: OrangeTex.jpg: Loading 1 faces(PF_B8G8R8,543x545x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,543x545x1.
13:57:47: [NxOgre] Shutting down.
13:57:47: [NxOgre] Removed frame listener.

betajaen

28-06-2006 18:15:11

I don't have a clue really, except it's the normal or it's offset, or the sphere is really big.

I'd post on the main forum if those aren't the problem.

magura

29-06-2006 01:59:51

if its not offset(make sure your object is at the centre of the scene) or normals(try ticking 'flip normals', and also tick export uv sets), make sure that the units are set up consistently throughout max and your application.

anear

03-07-2006 14:43:56

Problem solved. Thanks, betajaen.

In 3d Max, I shall use generic unit instead of metric unit. A 1 metre sphere exported from 3ds is a huge one, comparing to the sphere.50cm.mesh or cube.1m.mesh.

I don't have a clue really, except it's the normal or it's offset, or the sphere is really big.