[pool/snooker project] problem with .mesh & .material

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
CyberCouf
Gnoblar
Posts: 19
Joined: Thu Sep 29, 2005 9:46 pm
Location: France

[pool/snooker project] problem with .mesh & .material

Post by CyberCouf »

I'm trying to initiate myself to game codding, i discovery ogre3d, it seems realy a good engine with a good comunity!

So in order to do my firsts steps, i'm going to do a pool game (yes there is so much existing pool games, but this one is a way for me to learn game dev).

I use the "BsdColision" Demo because it's not so far to my aim.

But i have my first probleme :(

I've made a 3D model for pool using blender (i'm new to blender too)
Image
i use the python script to export my model in xml, and after use comand line tool to convert into .mesh
(i got some warnings: "Ignored face with 2 edges")
in my code i added :

Code: Select all

// Create the entity
Ogre::Entity* mEntity = mSceneMgr->createEntity( "Billard","billard.mesh" );
// Create the scene node
Ogre::SceneNode* mNode = mSceneMgr->getRootSceneNode( )->createChildSceneNode( "BillardNode", Vector3( -150, 40, 30 ) );
mNode->attachObject( mEntity );
.. and ingame :
Image
missing faces, seems no materials.. :(

in log file:
23:17:03: Mesh: Loading billard.mesh.
23:17:03: Can't assign material Material.001 to SubEntity of Billard because this Material does not exist. Have you forgotten to define it in a .material script?
i don't understand well how to apply a material, and also why i haven't all my faces .
Last edited by CyberCouf on Sun Oct 02, 2005 1:34 pm, edited 3 times in total.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

Be sure your face normals point outwards (quick test in Blender press "P" with "Solid" draw type, or use the "Draw Normals" option). Also be sure that your Ogre application can find the exported .material file. Blender's manual is available via the "Help" menu (Help->Manual).
CyberCouf
Gnoblar
Posts: 19
Joined: Thu Sep 29, 2005 9:46 pm
Location: France

Post by CyberCouf »

ok, i've corrected all my normals i've a the .material file, but i don't find how to use it in ogre. (may be there is a tutorial for mesh/material import but i didn't find it :( )
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

are you using the Media folder like the ogre tutorials/examples have? if so, put ur model in the models folder and the material in the material folder etc, this way ogre will find it

btw, looks cool!, i love pool/snooker, was playing it tonight actually :P
CyberCouf
Gnoblar
Posts: 19
Joined: Thu Sep 29, 2005 9:46 pm
Location: France

Post by CyberCouf »

i don't understand how to use .material files :

after exporting from blender, i've my .xml and the .material, after a conversion: .mesh .material

i put the billiard.mesh into \media\models and no pb, i can use it in my code
but i put the billiard.material into \media\materials\scripts, and in log file:
18:22:48: Mesh: Loading billard.mesh.
18:22:48: Can't assign material Material.001/SOLID to SubEntity of Billard because this Material does not exist. Have you forgotten to define it in a .material script?

is there a mapping between .mesh name and .material name?
my xml:

Code: Select all

<mesh>
	<submeshes>
		<submesh material="Material.001" usesharedvertices="false" use32bitindexes="false" operationtype="triangle_list">
			<faces count="392">
				<face v1="0" v2="1" v3="3"/>
...
my material:

Code: Select all

material Material.001
{
	receive_shadows on
	technique
	{
		pass
		{
			ambient 0.427287 0.427287 0.427287 1.000000
			diffuse 0.159601 0.504432 0.267361 1.000000
			specular 0.039391 0.298061 0.153015 1.000000 10.750000
			emissive 0.000000 0.000000 0.000000 1.000000
		}
	}
}

why he doesn't find "Material.001" ?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

I don't know how to rename/assign material names in Blender, but I do know that . and _ and spaces in material names will bring trouble. :wink:
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

CyberCouf wrote:18:22:48: Can't assign material Material.001/SOLID
Material.001/SOLID is not defined in your material file. Did you made any changes to the exported files?
CyberCouf
Gnoblar
Posts: 19
Joined: Thu Sep 29, 2005 9:46 pm
Location: France

Post by CyberCouf »

ok thanks! i changed the material name, without spaces or dot, it works

Image

now i'm looking for setting up collisions on my model, i hop i'll find it in the tutorials.
User avatar
Phantom
Greenskin
Posts: 106
Joined: Mon Aug 02, 2004 10:28 pm
Location: Helsinki, Finland

Post by Phantom »

You are missing 5 balls, and they are way too big :)

And is this snooker or pool? I guess Pool since you don't have snookers addittional balls on the table...

(Yea I know it's offtopic but I thought it's worth mentioning)
CyberCouf
Gnoblar
Posts: 19
Joined: Thu Sep 29, 2005 9:46 pm
Location: France

Post by CyberCouf »

don't worry, this is realy just some tests :wink:

the first step is to have a working "core", (interactions, physics, ...)

after that, i'll custom the models, put the trues dimmensions, ball color etc...
all for a real pool game :)
Post Reply