Jump to content
  • Advertisement
Sign in to follow this  
Yourself

[OGRE] manualobject vs stencil shadows

This topic is 3050 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, this is an ogre project :) I'm trying to have a manualobject cast stencil shadows. the manual states that if you want this, you have to define the indices and I have done that :) now the problem is that the shadows aren't working at they should :( the shadows are totaly wrong and whenever I move the camera, the are following me (they look like some kind of overlay). some code about what I do :
ManualObject* manual = mSceneMgr->createManualObject("manual");
		manual->begin("CubeMTL", RenderOperation::OT_TRIANGLE_LIST );
		std::vector<OBJTriangle>::iterator it = TriangleList.begin();
		int ind = 0;
		for (;it!=TriangleList.end();++it)
		{
			OBJTriangle current = (*it);
			for (int i = 0;i<3;++i)
			{	
				manual->position(current.vert.x,current.vert.y,current.vert.z);
				manual->normal(current.norm.x,current.norm.y,current.norm.z);
				manual->textureCoord(current.UV.u,current.UV.v);
				int blabla = ind*3 + i;
				manual->index(blabla);
			}
			ind++;
		}
		manual->end();
		manual->setCastShadows(true);
		SceneNode* mm = SceneMgr->getRootSceneNode()->createChildSceneNode("manualobj",Vector3(0,0,0));
		mm->attachObject(manual);
as you can see, I'm parsing an obj file (School assignment). I know for sure that the indices are correct, c'se I don't really need them (when in comment, the model stays the same) and when I change them (cf. int blabla = ind*3 - i;), the model is drawn wrong... So, what I'm I doing wrong/forgetting ?? cheers

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!