addShadowVolumeSceneNode and shadow very far from mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
eviral
Posts: 91
Joined: Mon Oct 25, 2004 10:25 am

addShadowVolumeSceneNode and shadow very far from mesh

Post by eviral »

Hello,

I have a strange bug...

The hero shadow is very far from him...


Here is a part of my code :

// add animated character
m_iMeshPlayer88 = mgr->getMesh("assets/characters/man/guy.x");
m_playerNode2 = mgr->addAnimatedMeshSceneNode(m_iMeshPlayer88, m_playerNode, NULL);
/*m_playerNode2->setPosition(core::vector3df(0.0f,-11.0f,-2.0f));
m_playerNode2->setScale(core::vector3df(0.3f,0.3f,0.3f));
m_playerNode2->setRotation(core::vector3df(0,180.0f,0));*/
m_playerNode2->setPosition(core::vector3df(0.0f,-10.0f,0.0f)); // Y is vertical hauteur, Z is near or far
m_playerNode2->setScale(core::vector3df(5.0f,5.0f,5.0f));
m_playerNode2->setRotation(core::vector3df(0.0f,90.0f,90.0f));
m_playerNode2->setFrameLoop(6,66); // idle pose
m_playerNode2->setAnimationSpeed(40);
m_playerNode2->setLoopMode(false);
m_playerNode2->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);


// add shadow
m_playerNode2->addShadowVolumeSceneNode();



mgr->setShadowColor(video::SColor(150,0,0,0));


Image




Please help

Thanks

Eviral
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Where's your light and how do you define it?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Unrelated but, thats a very nice looking project. Are you using normalmapping on that model in the background?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply