my project. really stuck!

Bilbob

18-02-2006 20:05:26

Hi.

I am having some trouble with meshes in the ogre engine. What i want to do is simple but i cant figure it out. What it is...

Im doing a project and im going to create a 3D version of the pool table level from micro machines which im sure u'l all remeber. I have created the table in max7 and attached the various object so i have all the different parts seperate such as the pockets, the table, the triangle, etc...

This is because i want to apply shaders to the different parts for the different effects, such as shiny balls, velvet texture, etc..

What i planned to do was to export the meshes from max7 using oFusion. But only using the .mesh files form the export. This i sbecause i have the shaders created in rendermonkey and have exported them using the rendermonkey ogre exporter.

I then wanted to load the meshes into one of the tutorial programs from the ogre website, then apply the shaders to the meshes to create the scene.

However im having great trouble in doing this because when i load the meshes into the program they are scattered around the world and not in the positions or rotation as they were in max. This was a problem i could get around because i could position the objects using the setPosition etc from the ogre engine commands. This meant i had the scene set up as i wanted and now need to add the shader material that i exported from rendermonkey.

But when i set these material to the objects they show up on the object but all the reposition and scaling i did has all been undone. I cant both apply my materials and move the objects.

I cant work out how i can get around this. Any help or thoughts much appreciated.


Sorry its so long but i wanted to make sure you knew exactly what was going on.

thank you

Bilbob

Lioric

19-02-2006 01:48:40

This is because your shader is using the vertex stream in object's space, you need to transform the vertex positions to world space by multipliying by the worldViewProj matrix