Beispiel #1
0
        public void AddNode(int oid, ObjectNode objNode)
        {
            // Create a namebar scene node and entity to handle names
            Axiom.MathLib.Vector3 offset    = new Axiom.MathLib.Vector3(0, 2 * Client.OneMeter, 0);
            SceneNode             sceneNode = objNode.SceneNode.CreateChildSceneNode("namebar." + oid, offset);
            TexturedBillboardSet  widget    = new TexturedBillboardSet("billboard." + oid);

            widget.MaterialName    = "font-material";
            widget.BillboardType   = BillboardType.Point;
            widget.CommonDirection = Axiom.MathLib.Vector3.NegativeUnitZ;
            sceneNode.AttachObject(widget);

            // Set the target mesh for methods like Font.DrawText
            meshRenderer.BeginRender(widget);
            Rect dummyRect = new Rect();

            dummyRect.left   = 0;
            dummyRect.top    = 0;
            dummyRect.Height = 150;
            dummyRect.Width  = 600;
            font.DrawText("This is a test", dummyRect, 0);
            meshRenderer.EndRender();
        }
        public void AddNode(int oid, ObjectNode objNode)
        {
            // Create a namebar scene node and entity to handle names
            Axiom.MathLib.Vector3 offset = new Axiom.MathLib.Vector3(0, 2 * Client.OneMeter, 0);
            SceneNode sceneNode = objNode.SceneNode.CreateChildSceneNode("namebar." + oid, offset);
            TexturedBillboardSet widget = new TexturedBillboardSet("billboard." + oid);
            widget.MaterialName = "font-material";
            widget.BillboardType = BillboardType.Point;
            widget.CommonDirection = Axiom.MathLib.Vector3.NegativeUnitZ;
            sceneNode.AttachObject(widget);

            // Set the target mesh for methods like Font.DrawText
            meshRenderer.BeginRender(widget);
            Rect dummyRect = new Rect();
            dummyRect.left = 0;
            dummyRect.top = 0;
            dummyRect.Height = 150;
            dummyRect.Width = 600;
            font.DrawText("This is a test", dummyRect, 0);
            meshRenderer.EndRender();
        }