# [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.

## 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();
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

1. 1
Rutin
18
2. 2
3. 3
JoeJ
12
4. 4
5. 5

• 16
• 18
• 10
• 13
• 17
• ### Forum Statistics

• Total Topics
631694
• Total Posts
3001747
×