예제 #1
0
        ClockNode(SceneNode parent, SceneManager smgr)
            : base(parent, smgr)
        {
            OnGetBoundingBox    += new GetBoundingBoxEventHandler(ClockNode_OnGetBoundingBox);
            OnGetMaterialCount  += new GetMaterialCountEventHandler(ClockNode_OnGetMaterialCount);
            OnGetMaterial       += new GetMaterialEventHandler(ClockNode_OnGetMaterial);
            OnRegisterSceneNode += new RegisterSceneNodeEventHandler(ClockNode_OnRegisterSceneNode);
            OnRender            += new RenderEventHandler(ClockNode_OnRender);
            OnAnimate           += new AnimateEventHandler(ClockNode_OnAnimate);

            // add clock face

            Mesh          mesh      = SceneManager.GeometryCreator.CreateCylinderMesh(100, 32, 6, new Color(180, 180, 180));
            MeshSceneNode clockFace = SceneManager.AddMeshSceneNode(mesh, this);

            clockFace.Rotation = new Vector3Df(90, 0, 0);
            clockFace.Position = new Vector3Df(0, 0, 10);
            mesh.Drop();

            clockFace.UpdateAbsolutePosition();
            boundingBox = clockFace.BoundingBoxTransformed;
            for (int i = 0; i < clockFace.MaterialCount; i++)
            {
                materialList.Add(clockFace.GetMaterial(i));
            }

            // add clock center

            mesh = SceneManager.GeometryCreator.CreateCylinderMesh(10, 24, 16, new Color(255, 255, 255), false);
            MeshSceneNode clockCenter = SceneManager.AddMeshSceneNode(mesh, this);

            clockCenter.Rotation = new Vector3Df(90, 0, 0);
            clockCenter.Position = new Vector3Df(0, 0, -14);
            mesh.Drop();

            clockCenter.UpdateAbsolutePosition();
            boundingBox.AddInternalBox(clockCenter.BoundingBoxTransformed);
            for (int i = 0; i < clockCenter.MaterialCount; i++)
            {
                materialList.Add(clockCenter.GetMaterial(i));
            }

            // add clock ticks

            for (int j = 0; j < 12; j++)
            {
                mesh = SceneManager.GeometryCreator.CreateCylinderMesh(5, 10, 16, new Color(255, 255, 255), false);
                MeshSceneNode clockTick = SceneManager.AddMeshSceneNode(mesh, this);
                clockTick.Rotation = new Vector3Df(90, 0, 0);

                float s = (float)Math.Sin((j * (360 / 12)) / (180 / Math.PI));
                float c = (float)Math.Cos((j * (360 / 12)) / (180 / Math.PI));
                clockTick.Position = new Vector3Df(s * 80, c * 80, 0);

                if ((j % 3) == 0)
                {
                    clockTick.Scale = new Vector3Df(2, 1, 2);
                }

                mesh.Drop();

                clockTick.UpdateAbsolutePosition();
                boundingBox.AddInternalBox(clockTick.BoundingBoxTransformed);
                for (int i = 0; i < clockTick.MaterialCount; i++)
                {
                    materialList.Add(clockTick.GetMaterial(i));
                }
            }

            // add hour arrow

            mesh       = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 40, 35, 4, 4, new Color(40, 40, 255), new Color(40, 40, 255));
            arrowHours = SceneManager.AddMeshSceneNode(mesh, this);
            arrowHours.GetMaterial(0).EmissiveColor = new Color(0, 0, 255);
            arrowHours.GetMaterial(1).EmissiveColor = new Color(0, 0, 255);
            arrowHours.Position = new Vector3Df(0, 0, 3);
            mesh.Drop();

            arrowHours.UpdateAbsolutePosition();
            boundingBox.AddInternalBox(arrowHours.BoundingBoxTransformed);
            for (int i = 0; i < arrowHours.MaterialCount; i++)
            {
                materialList.Add(arrowHours.GetMaterial(i));
            }

            // add minute arrow

            mesh         = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 60, 50, 4, 4, new Color(40, 255, 40), new Color(40, 255, 40));
            arrowMinutes = SceneManager.AddMeshSceneNode(mesh, this);
            arrowMinutes.GetMaterial(0).EmissiveColor = new Color(0, 255, 0);
            arrowMinutes.GetMaterial(1).EmissiveColor = new Color(0, 255, 0);
            arrowMinutes.Position = new Vector3Df(0, 0, -5);
            mesh.Drop();

            arrowMinutes.UpdateAbsolutePosition();
            boundingBox.AddInternalBox(arrowMinutes.BoundingBoxTransformed);
            for (int i = 0; i < arrowMinutes.MaterialCount; i++)
            {
                materialList.Add(arrowMinutes.GetMaterial(i));
            }

            // add second arrow

            mesh         = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 70, 60, 2, 2, new Color(255, 40, 40), new Color(255, 40, 40));
            arrowSeconds = SceneManager.AddMeshSceneNode(mesh, this);
            arrowSeconds.GetMaterial(0).EmissiveColor = new Color(255, 0, 0);
            arrowSeconds.GetMaterial(1).EmissiveColor = new Color(255, 0, 0);
            arrowSeconds.Position = new Vector3Df(0, 0, -11);
            mesh.Drop();

            arrowSeconds.UpdateAbsolutePosition();
            boundingBox.AddInternalBox(arrowSeconds.BoundingBoxTransformed);
            for (int i = 0; i < arrowSeconds.MaterialCount; i++)
            {
                materialList.Add(arrowSeconds.GetMaterial(i));
            }

            SceneManager.AddLightSceneNode(arrowSeconds, new Vector3Df(0, 70, 0), new Colorf(arrowSeconds.GetMaterial(0).EmissiveColor), 80);
            SceneManager.AddLightSceneNode(arrowMinutes, new Vector3Df(0, 60, 0), new Colorf(arrowMinutes.GetMaterial(0).EmissiveColor), 60);
            SceneManager.AddLightSceneNode(arrowHours, new Vector3Df(0, 40, 0), new Colorf(arrowHours.GetMaterial(0).EmissiveColor), 40);
        }
예제 #2
0
        static void Main()
        {
            DriverType?driverType = AskForDriver();

            if (!driverType.HasValue)
            {
                return;
            }

            IrrlichtDevice device = IrrlichtDevice.CreateDevice(driverType.Value, new Dimension2Di(800, 600));

            if (device == null)
            {
                return;
            }

            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);
            device.SetWindowCaption("Mesh handling - Irrlicht Engine - press [1], [2], [3] to regenerate mesh");
            VideoDriver  driver = device.VideoDriver;
            SceneManager scene  = device.SceneManager;

            // Generate starting height map and mesh

            HeightMap map = new HeightMap(255, 255);

            map.Generate(HeightMap.HeightFunc.EggBox);

            HeightMesh mesh = new HeightMesh();

            mesh.Init(driver, map, 50.0f, HeightMesh.ColorFunc.GreyscaleBasedOnTheHeight);

            // Add the mesh to the scene graph

            MeshSceneNode meshnode = scene.AddMeshSceneNode(mesh.Mesh);

            meshnode.SetMaterialFlag(MaterialFlag.BackFaceCulling, false);

            // Add light (just for nice effects)

            LightSceneNode    lightnode = scene.AddLightSceneNode(null, new Vector3Df(0, 100, 0), new Colorf(1, 1, 1), 500.0f);
            SceneNodeAnimator anim      = scene.CreateFlyCircleAnimator(new Vector3Df(0, 150, 0), 250.0f);

            lightnode.AddAnimator(anim);
            anim.Drop();

            // Add camera

            CameraSceneNode camera = scene.AddCameraSceneNodeFPS();

            camera.Position = new Vector3Df(-20.0f, 100.0f, -20.0f);
            camera.Target   = new Vector3Df(200.0f, -100.0f, 200.0f);
            camera.FarValue = 20000.0f;

            // Main loop

            while (device.Run())
            {
                if (!device.WindowActive)
                {
                    device.Sleep(100);
                    continue;
                }

                if (IsKeyDown(KeyCode.KeyW))
                {
                    meshnode.SetMaterialFlag(MaterialFlag.Wireframe, !meshnode.GetMaterial(0).Wireframe);
                }
                else if (IsKeyDown(KeyCode.Key1))
                {
                    map.Generate(HeightMap.HeightFunc.EggBox);
                    mesh.Init(driver, map, 50.0f, HeightMesh.ColorFunc.GreyscaleBasedOnTheHeight);
                }
                else if (IsKeyDown(KeyCode.Key2))
                {
                    map.Generate(HeightMap.HeightFunc.MoreSine);
                    mesh.Init(driver, map, 50.0f, HeightMesh.ColorFunc.CoordinateInterpolation);
                }
                else if (IsKeyDown(KeyCode.Key3))
                {
                    map.Generate(HeightMap.HeightFunc.JustExp);
                    mesh.Init(driver, map, 50.0f, HeightMesh.ColorFunc.CoordinateInterpolation);
                }

                driver.BeginScene();
                scene.DrawAll();
                driver.EndScene();
            }

            // Clean up

            mesh.Drop();
            device.Drop();
        }
예제 #3
0
        public Application()
        {
            _01.HelloWorld.Kinect kinect = new _01.HelloWorld.Kinect();
            mfX = mouseX = 840; mfY = mouseY = 525; mouseL = false; mouseR = false;
            //device = IrrlichtDevice.CreateDevice(
            //    DriverType.Direct3D9, new Dimension2Di(800, 600), 16, false, true, false);
            //                                                           |
            device = IrrlichtDevice.CreateDevice(                    // \|/ Fullscreen
                DriverType.Direct3D9, new Dimension2Di(1680, 1050), 32, false, true, false);

            device.SetWindowCaption("BENder3D");

            VideoDriver    driver = device.VideoDriver;
            SceneManager   smgr   = device.SceneManager;
            GUIEnvironment gui    = device.GUIEnvironment;

            device.OnEvent   += new IrrlichtDevice.EventHandler(device_OnEvent);
            smgr.AmbientLight = new Colorf(128, 128, 128, 128);
            //smgr.AddLightSceneNode(null, new Vector3Df(0, 70, 0), new Colorf(122,0,122,0), (float)10);
            MeshSceneNode box = smgr.AddCubeSceneNode(100, null, 9001, new Vector3Df(0.0f, -ballRadius * 3 / 2, 0.0f));

            box.Scale = new Vector3Df(100.0f, 0.1f, 100.0f);
            //Mesh cyl = smgr.GeometryCreator.CreateCylinderMesh(ballRadius, 50, 256);
            //Mesh sphere = smgr.GeometryCreator.CreateSphereMesh(ballRadius, 16,16);
            //MeshSceneNode t = smgr.AddSphereSceneNode(ballRadius, 32);
            //MeshSceneNode t = smgr.AddOctreeSceneNode(sphere);
            MeshSceneNode t = smgr.AddMeshSceneNode(smgr.GetMesh("pill.obj"));
            //MeshSceneNode t = smgr.AddMeshSceneNode(cyl);
            TriangleSelector triselect = smgr.CreateTriangleSelector(t.Mesh, t);

            t.TriangleSelector = triselect;
            triselect.Drop();
            //t = smgr.AddMeshSceneNode(smgr.GetMesh("../../media/sphere.x"));
            //smgr
            t.SetMaterialTexture(0, driver.GetTexture("rockwall.jpg"));
            //t.SetMaterialFlag(MaterialFlag.Lighting, true);
            t.GetMaterial(0).SpecularColor.Set(0, 0, 0);
            //t.GetMaterial(0).Lighting = true;
            t.GetMaterial(0).NormalizeNormals = false;

            /*Texture citrus = driver.AddTexture(new Dimension2Di(200, 200), "citrus.png");
             * gui.AddImage(citrus, new Vector2Di(824, 0), true);*/
            gui.AddStaticText("Hey, Listen! Press C to switch the mesh to a cylinder!\n Press S to change to a sphere, and enter to send yourself the obj file!", new Recti(0, 0, 400, 60));
            //t.AddShadowVolumeSceneNode();
            //           driver.GPUProgrammingServices.OnSetConstants += new GPUProgrammingServices.SetConstantsHandler(gpu_OnSetConstants);

            /*
             * MaterialType shaderMat = MaterialType.Solid;
             * shaderMat = driver.GPUProgrammingServices.AddHighLevelShaderMaterialFromFiles("C:/IrrlichtLime-1.4/examples/01.HelloWorld/bumpmap.hlsl", "VertexShaderFunction", VertexShaderType.VS_3_0,
             * "C:/IrrlichtLime-1.4/examples/01.HelloWorld/bumpmap.hlsl", "PixelShaderFunction", PixelShaderType.PS_3_0, MaterialType.Solid);
             *
             * t.SetMaterialType(shaderMat);
             * t.SetMaterialTexture(1, driver.GetTexture("../../media/rockwall_height.bmp"));*/

            GPUProgrammingServices gpu = driver.GPUProgrammingServices;
            MaterialType           newMaterialType1 = MaterialType.Solid;
            MaterialType           newMaterialType2 = MaterialType.TransparentAddColor;

            gpu.OnSetConstants += new GPUProgrammingServices.SetConstantsHandler(gpu_OnSetConstants);

            // create the shaders depending on if the user wanted high level or low level shaders

            newMaterialType1 = gpu.AddHighLevelShaderMaterialFromFiles(
                "d3d9.hlsl", "vertexMain", VertexShaderType.VS_1_1,
                "d3d9.hlsl", "pixelMain", PixelShaderType.PS_1_1,
                MaterialType.Solid, 0, GPUShadingLanguage.Default);
            t.SetMaterialType(newMaterialType1);
            //t.GetMaterial(0).Wireframe = true;
            //t.DebugDataVisible = DebugSceneType.Full;
            //t.AddShadowVolumeSceneNode(null, -1, false, 1000.0f);
            smgr.AddLightSceneNode(null, new Vector3Df(40, 150, -50), new Colorf(255, 255, 255, 255), 250.0f);
            //CSampleSceneNode sceneNode = new CSampleSceneNode(smgr.RootNode, smgr, 667);
            camera = smgr.AddCameraSceneNode(null, new Vector3Df(0, 50, -140), new Vector3Df(0, 5, 0));

            //camera.Target = new Vector3Df(-70, 30, -60);
            //smgr.AddCameraSceneNodeFPS(null, (float)50.0);
            Material m = new Material();

            m.Lighting = false;
            double PI        = 3.1415926f;
            float  distance  = 200.0f;
            double angle     = 180.0f;
            double angleY    = 20.0f;
            int    oldMouseX = mouseX;
            int    oldMouseY = mouseY;



            uint then          = device.Timer.Time;
            uint currentAutism = device.Timer.Time;
            bool autism        = false;

            while (device.Run())
            {
                uint  now            = device.Timer.Time;
                float frameDeltaTime = (float)(now - then) / 1000.0f;
                then = now;
                if (kinect.isTranslating && (kinect.translation.X < 30 && kinect.translation.X > -30))
                {
                    mfX -= (int)(kinect.translation.X);
                    mfY -= (int)(kinect.translation.Y);

                    Console.WriteLine(mouseX + ", " + mouseY + " ----------------- " + (int)(kinect.translation.X) + ", " + (int)(kinect.translation.Y));
                }

                kinect.resetTranslation();

                /*
                 * if (getDistance((int)mfX, (int)mfY, 512, 384) > 150)
                 * {
                 *  mfX = 512; mfY= 384;
                 * }*/


                mouseX = Math.Abs((int)mfX) % 1024;
                mouseY = Math.Abs((int)mfY) % 768;
                //mouseX = kinect.position.X;

                device.CursorControl.Position = new Vector2Di(mouseX, mouseY);

                if (!potterWheelDown && IsKeyDown(KeyCode.Up))
                {
                    potterWheelDown     = true;
                    deltaAngle          = 1.0d;
                    potterWheelActivate = !potterWheelActivate;
                }
                else if (!IsKeyDown(KeyCode.Up))
                {
                    potterWheelDown = false;
                }
                if (!leftKeyPressed && IsKeyDown(KeyCode.Left))
                {
                    leftKeyPressed = true;
                    deltaAngle    /= 2;
                }
                else if (!IsKeyDown(KeyCode.Left))
                {
                    leftKeyPressed = false;
                }
                if (!rightKeyPressed && IsKeyDown(KeyCode.Right))
                {
                    rightKeyPressed = true;
                    deltaAngle     *= 2;
                }
                else if (!IsKeyDown(KeyCode.Right))
                {
                    rightKeyPressed = false;
                }
                if (potterWheelActivate)
                {
                    angle -= 700.0f * deltaAngle * frameDeltaTime;
                }

                if (angle > 360)
                {
                    angle -= 360;
                }
                else if (angle < 0)
                {
                    angle += 360;
                }

                if (angleY > 360)
                {
                    angle -= 360;
                }
                else if (angleY < 0)
                {
                    angleY += 360;
                }
                driver.BeginScene(true, true, new Color(100, 101, 140));
                camera.Target = new Vector3Df(0, 0, 0);
                double temp = Math.Cos(angleY * PI / 180.0) * distance;
                double X    = Math.Sin(angle * PI / 180.0) * temp;
                double Y    = Math.Sin(angleY * PI / 180.0) * distance;
                double Z    = Math.Cos(angle * PI / 180.0) * temp;
                camera.Position = new Vector3Df((float)X, (float)Y, (float)Z);
                smgr.DrawAll();

                gui.DrawAll();
                driver.SetMaterial(m);
                Triangle3Df triangle = interpolateFrom2D(new Vector2Di(mouseX, mouseY));
                if (kinect.isMorphing && kinect.morphDist > 0)
                //if (IsKeyDown(KeyCode.KeyW))
                {
                    //Console.WriteLine("PRESSED KEY");
                    triangle.A *= new Vector3Df(0.5f);
                    triangle.B *= new Vector3Df(0.5f);
                    triangle.C *= new Vector3Df(0.5f);
                    if (isCyl)
                    {
                        deformCyl(t, triangle.A, new Vector3Df(.5f / (potterWheelActivate ? (float)(1 / deltaAngle) : 60f)), triangle);
                    }
                    else
                    {
                        deformMesh(t, triangle.A, new Vector3Df(.5f / (potterWheelActivate ? (float)(1 / deltaAngle) : 60f)), triangle);
                    }
                }
                else if (kinect.isMorphing && kinect.morphDist < 0)
                {
                    //Console.WriteLine("PRESSED KEY");
                    triangle.A *= new Vector3Df(1.5f);
                    triangle.B *= new Vector3Df(1.5f);
                    triangle.C *= new Vector3Df(1.5f);
                    if (isCyl)
                    {
                        deformCyl(t, triangle.A, new Vector3Df(-.5f / (potterWheelActivate ? (float)(1 / deltaAngle) : 60f)), triangle);
                    }
                    else
                    {
                        deformMesh(t, triangle.A, new Vector3Df(-.5f / (potterWheelActivate ? (float)(1 / deltaAngle) : 60f)), triangle);
                    }
                }
                if (kinect.isZoom && kinect.zoomDist < 0)
                {
                    if (distance < 300.0f)
                    {
                        distance += .0625f;
                    }
                }
                if (kinect.isZoom && kinect.zoomDist > 0)
                {
                    if (distance > 150)
                    {
                        distance -= .0625f;
                    }
                }
                if (kinect.isRotating && kinect.rotation > 0)
                {
                    angle += 200 * frameDeltaTime;
                }
                if (kinect.isRotating && kinect.rotation < 0)
                {
                    angle -= 200 * frameDeltaTime;
                }

                //Change shape

                if (IsKeyDown(KeyCode.KeyA))
                {
                    IrrlichtLime.IO.WriteFile file = device.FileSystem.CreateWriteFile("./Saved.obj");
                    writeMesh(file, t.Mesh, 1);

                    mail();
                }
                if (IsKeyDown(KeyCode.KeyC))
                {
                    isCyl = true;
                    t.Remove();
                    t = smgr.AddMeshSceneNode(smgr.GetMesh("pill.obj"));
                    //MeshSceneNode t = smgr.AddMeshSceneNode(cyl);
                    triselect          = smgr.CreateTriangleSelector(t.Mesh, t);
                    t.TriangleSelector = triselect;
                    triselect.Drop();
                    //t = smgr.AddMeshSceneNode(smgr.GetMesh("../../media/sphere.x"));
                    //smgr
                    t.SetMaterialTexture(0, driver.GetTexture("rockwall.jpg"));
                    //t.SetMaterialFlag(MaterialFlag.Lighting, true);
                    t.GetMaterial(0).SpecularColor.Set(0, 0, 0);
                    //t.GetMaterial(0).Lighting = true;
                    t.GetMaterial(0).NormalizeNormals = false;
                    t.SetMaterialType(newMaterialType1);
                }
                else if (IsKeyDown(KeyCode.KeyS))
                {
                    isCyl = false;
                    t.Remove();
                    t                  = smgr.AddSphereSceneNode(ballRadius, 32);
                    triselect          = smgr.CreateTriangleSelector(t.Mesh, t);
                    t.TriangleSelector = triselect;
                    triselect.Drop();
                    //t = smgr.AddMeshSceneNode(smgr.GetMesh("../../media/sphere.x"));
                    //smgr
                    t.SetMaterialTexture(0, driver.GetTexture("rockwall.jpg"));
                    //t.SetMaterialFlag(MaterialFlag.Lighting, true);
                    t.GetMaterial(0).SpecularColor.Set(0, 0, 0);
                    //t.GetMaterial(0).Lighting = true;
                    t.GetMaterial(0).NormalizeNormals = false;
                    t.SetMaterialType(newMaterialType1);
                }
                driver.EndScene();
            }

            device.Drop();
        }
예제 #4
0
		ClockNode(SceneNode parent, SceneManager smgr)
			: base(parent, smgr)
		{
			OnGetBoundingBox += new GetBoundingBoxEventHandler(ClockNode_OnGetBoundingBox);
			OnGetMaterialCount += new GetMaterialCountEventHandler(ClockNode_OnGetMaterialCount);
			OnGetMaterial += new GetMaterialEventHandler(ClockNode_OnGetMaterial);
			OnRegisterSceneNode += new RegisterSceneNodeEventHandler(ClockNode_OnRegisterSceneNode);
			OnRender += new RenderEventHandler(ClockNode_OnRender);
			OnAnimate += new AnimateEventHandler(ClockNode_OnAnimate);

			// add clock face

			Mesh mesh = SceneManager.GeometryCreator.CreateCylinderMesh(100, 32, 6, new Color(180, 180, 180));
			MeshSceneNode clockFace = SceneManager.AddMeshSceneNode(mesh, this);
			clockFace.Rotation = new Vector3Df(90, 0, 0);
			clockFace.Position = new Vector3Df(0, 0, 10);
			mesh.Drop();

			clockFace.UpdateAbsolutePosition();
			boundingBox = clockFace.BoundingBoxTransformed;
			for (int i = 0; i < clockFace.MaterialCount; i++) materialList.Add(clockFace.GetMaterial(i));
			
			// add clock center

			mesh = SceneManager.GeometryCreator.CreateCylinderMesh(10, 24, 16, new Color(255, 255, 255), false);
			MeshSceneNode clockCenter = SceneManager.AddMeshSceneNode(mesh, this);
			clockCenter.Rotation = new Vector3Df(90, 0, 0);
			clockCenter.Position = new Vector3Df(0, 0, -14);
			mesh.Drop();

			clockCenter.UpdateAbsolutePosition();
			boundingBox.AddInternalBox(clockCenter.BoundingBoxTransformed);
			for (int i = 0; i < clockCenter.MaterialCount; i++) materialList.Add(clockCenter.GetMaterial(i));

			// add clock ticks

			for (int j = 0; j < 12; j++)
			{
				mesh = SceneManager.GeometryCreator.CreateCylinderMesh(5, 10, 16, new Color(255, 255, 255), false);
				MeshSceneNode clockTick = SceneManager.AddMeshSceneNode(mesh, this);
				clockTick.Rotation = new Vector3Df(90, 0, 0);

				float s = (float)Math.Sin((j * (360 / 12)) / (180 / Math.PI));
				float c = (float)Math.Cos((j * (360 / 12)) / (180 / Math.PI));
				clockTick.Position = new Vector3Df(s * 80, c * 80, 0);

				if ((j % 3) == 0)
					clockTick.Scale = new Vector3Df(2, 1, 2);

				mesh.Drop();

				clockTick.UpdateAbsolutePosition();
				boundingBox.AddInternalBox(clockTick.BoundingBoxTransformed);
				for (int i = 0; i < clockTick.MaterialCount; i++) materialList.Add(clockTick.GetMaterial(i));
			}

			// add hour arrow

			mesh = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 40, 35, 4, 4, new Color(40, 40, 255), new Color(40, 40, 255));
			arrowHours = SceneManager.AddMeshSceneNode(mesh, this);
			arrowHours.GetMaterial(0).EmissiveColor = new Color(0, 0, 255);
			arrowHours.GetMaterial(1).EmissiveColor = new Color(0, 0, 255);
			arrowHours.Position = new Vector3Df(0, 0, 3);
			mesh.Drop();

			arrowHours.UpdateAbsolutePosition();
			boundingBox.AddInternalBox(arrowHours.BoundingBoxTransformed);
			for (int i = 0; i < arrowHours.MaterialCount; i++) materialList.Add(arrowHours.GetMaterial(i));

			// add minute arrow

			mesh = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 60, 50, 4, 4, new Color(40, 255, 40), new Color(40, 255, 40));
			arrowMinutes = SceneManager.AddMeshSceneNode(mesh, this);
			arrowMinutes.GetMaterial(0).EmissiveColor = new Color(0, 255, 0);
			arrowMinutes.GetMaterial(1).EmissiveColor = new Color(0, 255, 0);
			arrowMinutes.Position = new Vector3Df(0, 0, -5);
			mesh.Drop();

			arrowMinutes.UpdateAbsolutePosition();
			boundingBox.AddInternalBox(arrowMinutes.BoundingBoxTransformed);
			for (int i = 0; i < arrowMinutes.MaterialCount; i++) materialList.Add(arrowMinutes.GetMaterial(i));

			// add second arrow

			mesh = SceneManager.GeometryCreator.CreateArrowMesh(12, 12, 70, 60, 2, 2, new Color(255, 40, 40), new Color(255, 40, 40));
			arrowSeconds = SceneManager.AddMeshSceneNode(mesh, this);
			arrowSeconds.GetMaterial(0).EmissiveColor = new Color(255, 0, 0);
			arrowSeconds.GetMaterial(1).EmissiveColor = new Color(255, 0, 0);
			arrowSeconds.Position = new Vector3Df(0, 0, -11);
			mesh.Drop();

			arrowSeconds.UpdateAbsolutePosition();
			boundingBox.AddInternalBox(arrowSeconds.BoundingBoxTransformed);
			for (int i = 0; i < arrowSeconds.MaterialCount; i++) materialList.Add(arrowSeconds.GetMaterial(i));

			SceneManager.AddLightSceneNode(arrowSeconds, new Vector3Df(0, 70, 0), new Colorf(arrowSeconds.GetMaterial(0).EmissiveColor), 80);
			SceneManager.AddLightSceneNode(arrowMinutes, new Vector3Df(0, 60, 0), new Colorf(arrowMinutes.GetMaterial(0).EmissiveColor), 60);
			SceneManager.AddLightSceneNode(arrowHours, new Vector3Df(0, 40, 0), new Colorf(arrowHours.GetMaterial(0).EmissiveColor), 40);
		}