andyhebear1
10-04-2014 06:59:11
mogre-procedural demo release v0.1 for Mogre1.6.x to 1.8.x
Good news, this first demo for mogre-procedural demo has been released:
mogre-procedural project: https://github.com/andyhebear/mogre-procedural
[mogre-procedural project was previously there: https://code.google.com/p/mogre-procedural/]. Old googlecode links do not work any longer.
//---------------------------------------
Download mogre-procedural demo release v0.1 binary files: https://mogre-procedural.googlecode.com/issues/attachment?aid=10000000&name=MogreProcedural_Release_v0.1.rar
with the more,please see:https://code.google.com/p/mogre-procedural/issues/list
the demo snap code:
Good news, this first demo for mogre-procedural demo has been released:
mogre-procedural project: https://github.com/andyhebear/mogre-procedural
[mogre-procedural project was previously there: https://code.google.com/p/mogre-procedural/]. Old googlecode links do not work any longer.
//---------------------------------------
Download mogre-procedural demo release v0.1 binary files: https://mogre-procedural.googlecode.com/issues/attachment?aid=10000000&name=MogreProcedural_Release_v0.1.rar
with the more,please see:https://code.google.com/p/mogre-procedural/issues/list
the demo snap code:
// Generates every type of primitive
new PlaneGenerator().setNumSegX(20).setNumSegY(20).setSizeX(150f).setSizeY(150f).setUTile(5.0f).setVTile(5.0f).realizeMesh("planeMesh");
putMesh2("planeMesh", new Vector3(0, 0, 0));
new SphereGenerator().setRadius(2.0f).setUTile(5.0f).setVTile(5.0f).realizeMesh("sphereMesh");
putMesh("sphereMesh", new Vector3(0, 10, 0));
new CylinderGenerator().setHeight(3.0f).setRadius(1.0f).setUTile(3.0f).realizeMesh("cylinderMesh");
putMesh("cylinderMesh", new Vector3(10, 10, 0));
new TorusGenerator().setRadius(3.0f).setSectionRadius(1.0f).setUTile(10.0f).setVTile(5.0f).realizeMesh("torusMesh");
putMesh("torusMesh", new Vector3(-10, 10, 0));
new ConeGenerator().setRadius(2.0f).setHeight(3.0f).setNumSegBase(36).setNumSegHeight(2).setUTile(3.0f).realizeMesh("coneMesh");
putMesh("coneMesh", new Vector3(0, 10, -10));
new TubeGenerator().setHeight(3.0f).setUTile(3.0f).realizeMesh("tubeMesh");
putMesh("tubeMesh", new Vector3(-10, 10, -10));
new BoxGenerator().setSizeX(2.0f).setSizeY(4.0f).setSizeZ(6.0f).realizeMesh("boxMesh");
putMesh("boxMesh", new Vector3(10, 10, -10));
//
new CapsuleGenerator().setHeight(2.0f).realizeMesh("capsuleMesh");
putMesh("capsuleMesh", new Vector3(0, 10, 10));
TorusKnotGenerator tkg = (new TorusKnotGenerator().setRadius(2.0f).setSectionRadius(0.5f).setUTile(3.0f) as TorusKnotGenerator);
tkg.setNumSegCircle(64).setNumSegSection(16).realizeMesh("torusKnotMesh");
putMesh("torusKnotMesh", new Vector3(-10, 10, 10));
//
new IcoSphereGenerator().setRadius(2.0f).setNumIterations(3).setUTile(5.0f).setVTile(5.0f).realizeMesh("icoSphereMesh");
putMesh("icoSphereMesh", new Vector3(10, 10, 10));
new RoundedBoxGenerator().setSizeX(1.0f).setSizeY(5.0f).setSizeZ(5.0f).setChamferSize(1.0f).realizeMesh("roundedBoxMesh");
putMesh("roundedBoxMesh",new Vector3(20,10,10));
new SpringGenerator().setNumSegCircle(32).setNumSegPath(30).realizeMesh("springMesh");
putMesh("springMesh",new Vector3(20,10,0));
void putMesh3(string meshName, Vector3 position) {
putMeshMat(meshName, "Procedural/Road", position, false);
}
//-------------------------------------------------------------------------------------
void putMesh2(string meshName, Vector3 position) {
putMeshMat(meshName, "Procedural/Rockwall", position, false);
}
//-------------------------------------------------------------------------------------
void putMesh(string meshName, Vector3 position) {
putMeshMat(meshName, "Procedural/BeachStones", position, true);
}
void putMeshMat(string meshName, string matName, Vector3 position, bool castShadows) {
Entity ent2 = mSceneMgr.CreateEntity(meshName);
SceneNode sn = mSceneMgr.RootSceneNode.CreateChildSceneNode();
sn.AttachObject(ent2);
sn.Position = (position);
ent2.SetMaterialName(matName);
ent2.CastShadows = (castShadows);
}