|
| 1 | +# mogre-procedural |
| 2 | +this is overwrite ogre-procedural c++ project using c#, look ogre-procedural c++ source http://code.google.com/p/ogre-procedural/ Ogre Procedural is a library for creating procedural geometry and textures for Ogre3d based projects. That includes : Primitives, such as box, sphere... Extruded shapes along paths or around an axis (useful for roads, rails...) Splines 2D Triangulation Textures (in default branch) if you has problem,please go to http://www.ogre3d.org/addonforums/viewtopic.php?f=33&t=30133 or http://www.ogre3d.org/addonforums/viewtopic.php?f=8&t=30124 ! then faceback to me. |
| 3 | + |
| 4 | + |
| 5 | +Simple Code |
| 6 | + |
| 7 | + // Generates every type of primitive |
| 8 | + |
| 9 | + new PlaneGenerator().setNumSegX(20).setNumSegY(20).setSizeX(150f).setSizeY(150f).setUTile(5.0f).setVTile(5.0f).realizeMesh("planeMesh"); |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + putMesh2("planeMesh", new Vector3(0, 0, 0)); |
| 14 | + |
| 15 | + new SphereGenerator().setRadius(2.0f).setUTile(5.0f).setVTile(5.0f).realizeMesh("sphereMesh"); |
| 16 | + |
| 17 | + putMesh("sphereMesh", new Vector3(0, 10, 0)); |
| 18 | + |
| 19 | + new CylinderGenerator().setHeight(3.0f).setRadius(1.0f).setUTile(3.0f).realizeMesh("cylinderMesh"); |
| 20 | + |
| 21 | + putMesh("cylinderMesh", new Vector3(10, 10, 0)); |
| 22 | + |
| 23 | + new TorusGenerator().setRadius(3.0f).setSectionRadius(1.0f).setUTile(10.0f).setVTile(5.0f).realizeMesh("torusMesh"); |
| 24 | + |
| 25 | + putMesh("torusMesh", new Vector3(-10, 10, 0)); |
| 26 | + |
| 27 | + new ConeGenerator().setRadius(2.0f).setHeight(3.0f).setNumSegBase(36).setNumSegHeight(2).setUTile(3.0f).realizeMesh("coneMesh"); |
| 28 | + |
| 29 | + putMesh("coneMesh", new Vector3(0, 10, -10)); |
| 30 | + |
| 31 | + new TubeGenerator().setHeight(3.0f).setUTile(3.0f).realizeMesh("tubeMesh"); |
| 32 | + |
| 33 | + putMesh("tubeMesh", new Vector3(-10, 10, -10)); |
| 34 | + |
| 35 | + new BoxGenerator().setSizeX(2.0f).setSizeY(4.0f).setSizeZ(6.0f).realizeMesh("boxMesh"); |
| 36 | + |
| 37 | + putMesh("boxMesh", new Vector3(10, 10, -10)); // |
| 38 | + |
| 39 | + new CapsuleGenerator().setHeight(2.0f).realizeMesh("capsuleMesh"); |
| 40 | + |
| 41 | + putMesh("capsuleMesh", new Vector3(0, 10, 10)); TorusKnotGenerator tkg = (new TorusKnotGenerator().setRadius(2.0f).setSectionRadius(0.5f).setUTile(3.0f) as TorusKnotGenerator); |
| 42 | + |
| 43 | + tkg.setNumSegCircle(64).setNumSegSection(16).realizeMesh("torusKnotMesh"); |
| 44 | + |
| 45 | + putMesh("torusKnotMesh", new Vector3(-10, 10, 10)); // |
| 46 | + |
| 47 | + new IcoSphereGenerator().setRadius(2.0f).setNumIterations(3).setUTile(5.0f).setVTile(5.0f).realizeMesh("icoSphereMesh"); |
| 48 | + |
| 49 | + putMesh("icoSphereMesh", new Vector3(10, 10, 10)); |
| 50 | + |
| 51 | + new RoundedBoxGenerator().setSizeX(1.0f).setSizeY(5.0f).setSizeZ(5.0f).setChamferSize(1.0f).realizeMesh("roundedBoxMesh"); |
| 52 | + |
| 53 | + putMesh("roundedBoxMesh",new Vector3(20,10,10)); |
| 54 | + |
| 55 | + new SpringGenerator().setNumSegCircle(32).setNumSegPath(30).realizeMesh("springMesh"); |
| 56 | + |
| 57 | + putMesh("springMesh",new Vector3(20,10,0)); |
| 58 | + |
0 commit comments