Not sure what I am doing wrong

Steve.Dev

16-04-2006 09:27:17

Hi all,

I am trying to use the oFusion scenelib and am running into an issue.
I created a test model in 3d studio and it shows fine in the oFusion viewport.
When I try loading the OSM file into the project it doesn't appear.

in the application code I do the following according to the documentation.


void createScene()
{
OSMScene oScene;
oSceneCallback oe_Callback;

oScene.initialise( "test.osm", &oe_Callback );

oScene.createScene();

mSceneMgr = oScene.getSceneManager();
}


Any direction would be helpful. Thanks.

Lioric

16-04-2006 18:43:30

Did you put the .mesh and .materials in your resource path folders?

What is the ogre.log that your application/project creates, any hints there?

Create a camera in max from where you see your scene, then in your application set this camera as the current

Steve.Dev

16-04-2006 18:53:17

Yup.
I have all the files exported in the resource path files.
Here is the scene in 3ds max


As for the log, this is what is logged for the oFusion
10:36:02: ********************************
10:36:02: ** oScene Loader Lib **
10:36:02: ********************************
10:36:02: oSceneLoader: Loading 'room.osm' file
10:36:02: oSceneLoader: Creating scene on 'Root' node
10:36:02: Mesh: Loading Ground.mesh.
10:36:02: Warning: VET_COLOUR element type is deprecated, you should use one of the more specific types to indicate the byte order. Use OgreMeshUpgrade on Ground.mesh as soon as possible.
10:36:02: D3D9 : ***** Dimensions altered by the render system
10:36:02: D3D9 : ***** Source image dimensions : 904x509
10:36:02: D3D9 : ***** Texture dimensions : 1024x512
10:36:02: Texture: stone39.jpg: Loading 1 faces(PF_B8G8R8,904x509x1) with 10 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x512x1.
10:36:02: Mesh: Loading Sphere.mesh.
10:36:02: ********************************
10:36:02: ** oSceneLoader: Scene loaded **



And the render window.



Thanks.

Lioric

16-04-2006 19:03:45

Can you post the osm file?

Try using more "suitable" power of two texture images (256, 512)

What is the result if you dont put the material file in the resource?

Implement an OnEntityCreated event to verify that the objects are loaded and use it to activate the "ShowAABB" to verify the node

Steve.Dev

17-04-2006 01:24:36


<oe_scene>
<sceneManager type="0" worldGeometry="terrain.cfg" />
<bkgcolor r="0" g="0" b="0" />
<lightColor r="0.5" g="0.5" b="0.5" />
<shadowTechnique type="1" tex_size="512" tex_count="6">
<color r="0" g="0" b="0" />
</shadowTechnique>
<lights>
<light name="Light1" type="spot" on="true" CastShadows="no" hotspot="43" falloff="45" intensity="1">
<position x="-82.8337" y="190.674" z="8.33463e-06" />
<rotation x="-0.184976" y="0.682484" z="-0.184976" w="-0.682484" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
<target name="Light1.Target">
<position x="17.5848" y="19.0313" z="8.31883e-07" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</target>
</light>
<light name="Omni01" type="omni" on="true" CastShadows="no" intensity="1">
<position x="16.2889" y="65.9133" z="4.58511" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
</light>
<light name="Omni02" type="omni" on="true" CastShadows="no" intensity="1">
<position x="-20.952" y="70.4013" z="8.72298" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
</light>
</lights>
<cameras>
<camera name="FirstCamera" FOV="0.785398">
<position x="-83.2053" y="44.9069" z="4.08075" />
<rotation x="-0.384502" y="0.579656" z="-0.357723" w="-0.623049" />
<scale x="1" y="1" z="1" />
<target name="FirstCamera.Target">
<position x="-6.39362" y="6.27489" z="-1.46911" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</target>
</camera>
</cameras>
<entities>
<entity name="Ground" hidden="false" filename="Ground.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="0.448549" y="0" z="0.725761" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1.01935" y="1.01935" z="1.01935" />
</entity>
<entity name="Sphere01" hidden="false" filename="Sphere01.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="-8.4299" y="14.4965" z="-2.62089" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</entity>
</entities>
</oe_scene>


Thanks for your help. I got it to work by removing


<sceneManager type="0" worldGeometry="terrain.cfg" />

The thing is, I selected that terrain.cfg in 3d studio as part of the world geometry. I no longer want to use it, but it keeps the information. Is there a way to clear it?

oFusion is a sweet product!!

Evak

17-04-2006 03:28:50

you know, I still have a similar problem in our implementation. Not sure quite what is wrong but I did find a solution.

In our engine after calling the OSM sceneloader and loading a scene I would get a blak screen, however adding shadows manualy (I'm using stencil modulate) after the scene loaded, then everything displays correctly.

So try enabling the shadows in your app after loading the scene, see if that helps.

(BG colour doesn't work, but I'm using the skybox feature in OSM anyway)

Lioric

17-04-2006 17:45:48

Shadows in Azathoth are defined different than in Dagon, this will be reviewed as soon as possible

The world geometry issue will be fixed in the next update