Autumn
29-07-2012 11:36:27
Hi community,
I'm using Mogre in windows form and I'm creating manualobjects from STL-Files, but I am not happy with the way they look.
Here is a minimal example:
What my cube looks like:
What i want my cube to look like: (edited with paint..)
I create my cube like this: (I create my manualobjects from STL-Files in a similar way using a Streamreader..)
I create a spotLight, pointLight and a directionalLight.
I create a plane with a texture for casting shadows on.
I am using STENCIL_ADDITIVE shadows.
My Material:
How can i make my objects look like the cube in the 2. picture?
They don't have to cast shadows. I just want the parts of my objects which are hit by light to be shiny and the parts which are not hit by light to be dark..
I don't know if I have to work on my lights, my material, the shadowtype i am using or the way I create my manualobjects...
Thanks
Autumn
I'm using Mogre in windows form and I'm creating manualobjects from STL-Files, but I am not happy with the way they look.
Here is a minimal example:
What my cube looks like:
What i want my cube to look like: (edited with paint..)
I create my cube like this: (I create my manualobjects from STL-Files in a similar way using a Streamreader..)
ManObjTest = mgr.CreateManualObject("ManObjTestTriangle");
ManObjTest.Begin("Blue", RenderOperation.OperationTypes.OT_TRIANGLE_LIST);
ManObjTest.Position(0, 0, 0);
ManObjTest.Position(100, 0, 0);
ManObjTest.Position(100, 100, 0);
ManObjTest.Position(0, 100, 0);
ManObjTest.Position(0, 0, 100);
ManObjTest.Position(100, 0, 100);
ManObjTest.Position(100, 100, 100);
ManObjTest.Position(0, 100, 100);
//bottom side
ManObjTest.Index(0);
ManObjTest.Index(2);
ManObjTest.Index(1);
ManObjTest.Index(0);
ManObjTest.Index(3);
ManObjTest.Index(2);
//end bottom
//left side
ManObjTest.Index(0);
ManObjTest.Index(4);
ManObjTest.Index(7);
ManObjTest.Index(0);
ManObjTest.Index(7);
ManObjTest.Index(3);
//end left
//front side
ManObjTest.Index(3);
ManObjTest.Index(7);
ManObjTest.Index(6);
ManObjTest.Index(3);
ManObjTest.Index(6);
ManObjTest.Index(2);
//end front
//back side
ManObjTest.Index(0);
ManObjTest.Index(1);
ManObjTest.Index(4);
ManObjTest.Index(1);
ManObjTest.Index(5);
ManObjTest.Index(4);
//end back
//right side
ManObjTest.Index(1);
ManObjTest.Index(6);
ManObjTest.Index(5);
ManObjTest.Index(1);
ManObjTest.Index(2);
ManObjTest.Index(6);
//end right
//up side
ManObjTest.Index(7);
ManObjTest.Index(4);
ManObjTest.Index(5);
ManObjTest.Index(5);
ManObjTest.Index(6);
ManObjTest.Index(7);
//end up
ManObjTest.End();
MeshPtr ManObjTestMes = ManObjTest.ConvertToMesh("MeshiQuad");
ManObjTestMes.BuildEdgeList();
MeshEnti = mgr.CreateEntity("MeshEntity", "MeshiQuad");
MeshEnti.CastShadows = true;
ManObjTestNode = mgr.RootSceneNode.CreateChildSceneNode("ManObjTestNodi");
ManObjTestNode.SetPosition(0, 0, 0);
ManObjTestNode.AttachObject(MeshEnti);
I create a spotLight, pointLight and a directionalLight.
I create a plane with a texture for casting shadows on.
I am using STENCIL_ADDITIVE shadows.
My Material:
material Blue
{
technique
{
pass
{
lighting off
texture_unit
{
texture blue.png
}
}
}
}
How can i make my objects look like the cube in the 2. picture?
They don't have to cast shadows. I just want the parts of my objects which are hit by light to be shiny and the parts which are not hit by light to be dark..
I don't know if I have to work on my lights, my material, the shadowtype i am using or the way I create my manualobjects...
Thanks
Autumn