Please help me... Problems with the textures normals. :(

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Janete
Kobold
Posts: 34
Joined: Wed Mar 15, 2006 5:41 pm

Please help me... Problems with the textures normals. :(

Post by Janete »

Hello,

I have some problems with the normals.

Here's the deal:

I developped a facial mesh in blender.
I exported with reimpell script preview-latest and see it mesh viewer and it was ok.

Problem:
Then I added some vertex keys animation and I tryed it facial_demo (that comes with ogre) and in the meshviewer and I couldn't see the materials in the mesh. It becomes black... or maybe very very dark, because I've added some red and I can see a dark red.

I can see it moving (I can see the information aboutr FPS) but I can't see the materials of the mesh.

When I'm running the Reimpell script, I also get this "Warning: error in normalize! Face of mesh "facial" too small."

I checked the normals in blender and they are outside. I've tryed to put this code but is still not working. Here's what I have done:

void createScene(void){

// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
l->setDiffuseColour(1.0, 1.0, 1.0);

// Create a light
l = mSceneMgr->createLight("MainLight2");
l->setPosition(-120,-80,-50);
l->setDiffuseColour(0.7, 0.7, 0.6);

MeshPtr mesh = MeshManager::getSingleton().load("Face.mesh", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

Animation* anim = mesh->createAnimation("manual", 0);

VertexAnimationTrack* track = anim->createVertexTrack(4, VAT_POSE);

manualKeyFrame = track->createVertexPoseKeyFrame(0);

// create pose references, initially zero
for (int i = 0; i < SI_COUNT; ++i){
manualKeyFrame->addPoseReference(poseIndexes, 0.0f);
}

// setup GUI system
mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,
Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);

mGUISystem = new CEGUI::System(mGUIRenderer);

CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);


Entity* head = mSceneMgr->createEntity("Face", "Face.mesh");
head->setNormaliseNormals(true);

speakAnimState = head->getAnimationState("Ao_calhas");
speakAnimState->setEnabled(true);

manualAnimState = head->getAnimationState("manual");
manualAnimState->setTimePosition(0);

SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();

headNode->attachObject(head);


mCamera->setPosition(20, -50, 0);
mCamera->setAutoTracking(true,headNode);

(...)

} //createScene(void)


I don't know if that's ok, but I searched for other examples and it was similar to this... I can't find what it's wrong...


I can't continue my work because of this... and where I work, there's no one who can help... :(

tnx.
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 »

It doesn't matter what you do in code, when your model is bad.
The exporter told you what the problem is: you have a face which is too small, probably zero in size.
You need to fix that in Blender.
Try W remove doubles.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Janete
Kobold
Posts: 34
Joined: Wed Mar 15, 2006 5:41 pm

Post by Janete »

No... the mesh is not bad... and I tryed with other facial mesh that I downloaded from the internet, and the problem is always the same.
If it doesn't have animation everything works fine, but if I add a vertex key for animation the textures become real dark.

I tryed to reduce to the maximum that Remove Doubles in blender allows, but it gives the same mistake and, after, it doesn't seems anymore with a face.

And I search and search for a way to solve it and I can't figure it out...

:(
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

Please download
http://www-public.tu-bs.de:8080/~y00077 ... est.tar.gz
again to be sure to use the latest preview version. There was an error in the export of normals of a smoothed mesh with shape animation in an older version.
Janete
Kobold
Posts: 34
Joined: Wed Mar 15, 2006 5:41 pm

Post by Janete »

THANK YOU SO SO MUCH! :D

It works now! I spent so many time trying to correct it. :)

Tnx
Post Reply