Esempio n. 1
0
        public override void CreateScene()
        {
            const uint constantColor = 123;

            SceneNode node1 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("Tutorial03Node1");
            SceneNode node2 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("Tutorial03Node2");

            ManualObject manualObj1 = sceneMgr.CreateManualObject("Tutorial03Object1");
            ManualObject manualObj2 = sceneMgr.CreateManualObject("Tutorial03Object2");


            /*                                  star    outer   inner  */
            /*                     x      y     Points  radius  radius */
            /*                  =====  =====  ======  ======  ====== */
            ManualObject.ManualObjectSection objSection;
            objSection = DrawStar(manualObj1, -10.0f, -10.0f, 5, 50.0f, 20.0f);
            objSection.SetCustomParameter(constantColor, new Vector4(0.0f, 1.0f, 0.0f, 1.0f));// Green

            objSection = DrawStar(manualObj2, 94.0f, 10.0f, 5, 50.0f, 20.0f);
            objSection.SetCustomParameter(constantColor, new Vector4(1.0f, 0.0f, 0.0f, 1.0f)); // Red

            node1.AttachObject(manualObj1);
            node2.AttachObject(manualObj2);

            MovableText text1 = new MovableText("text1", this.sceneMgr, node1, new Size(128, 32));

            text1.SetText("Node 1!", new System.Drawing.Font(FontFamily.GenericSansSerif, 16, FontStyle.Regular, GraphicsUnit.Pixel), Color.Green);
            text1.Offset = new Vector3(-10.0f + 25f, -10.0f + 25f, 5.0f);

            MovableText text2 = new MovableText("text2", this.sceneMgr, node2, new Size(128, 32));

            text2.SetText("Node 2!", new System.Drawing.Font(FontFamily.GenericSerif, 16, FontStyle.Regular, GraphicsUnit.Pixel), Color.Red);
            text2.Offset = new Vector3(94.0f + 25f, 10.0f + 25f, 5.0f);
        }
Esempio n. 2
0
        public override void CreateScene()
        {
            const uint constantColor = 123;

            SceneNode node1 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("Tutorial03Node1");
            SceneNode node2 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("Tutorial03Node2");

            ManualObject manualObj1 = sceneMgr.CreateManualObject("Tutorial03Object1");
            ManualObject manualObj2 = sceneMgr.CreateManualObject("Tutorial03Object2");

            /*                                  star    outer   inner  */
            /*                     x      y     Points  radius  radius */
            /*                  =====  =====  ======  ======  ====== */
            ManualObject.ManualObjectSection objSection;
            objSection = DrawStar(manualObj1, -10.0f, -10.0f, 5, 50.0f, 20.0f);
            objSection.SetCustomParameter(constantColor, new Vector4(0.0f, 1.0f, 0.0f, 1.0f));// Green

            objSection = DrawStar(manualObj2, 94.0f, 10.0f, 5, 50.0f, 20.0f);
            objSection.SetCustomParameter(constantColor, new Vector4(1.0f, 0.0f, 0.0f, 1.0f)); // Red

            node1.AttachObject(manualObj1);
            node2.AttachObject(manualObj2);

            MovableText text1 = new MovableText("text1", this.sceneMgr, node1, new Size(128, 32));
            text1.SetText("Node 1!", new System.Drawing.Font(FontFamily.GenericSansSerif, 16, FontStyle.Regular, GraphicsUnit.Pixel), Color.Green);
            text1.Offset = new Vector3(-10.0f + 25f, -10.0f + 25f, 5.0f);

            MovableText text2 = new MovableText("text2", this.sceneMgr, node2, new Size(128, 32));
            text2.SetText("Node 2!", new System.Drawing.Font(FontFamily.GenericSerif, 16, FontStyle.Regular, GraphicsUnit.Pixel), Color.Red);
            text2.Offset = new Vector3(94.0f + 25f, 10.0f + 25f, 5.0f);
        }