Sign in to follow this  
Yourself

[OGRE] manualobject vs stencil shadows

Recommended Posts

Yourself    1961
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[i].x,current.vert[i].y,current.vert[i].z);
				manual->normal(current.norm[i].x,current.norm[i].y,current.norm[i].z);
				manual->textureCoord(current.UV[i].u,current.UV[i].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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this