예제 #1
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            gDevice = devIf.Device;

            // create font
            font = new Font(gDevice, fontSize, 0, fontWeight, 1, false,
                            CharacterSet.Ansi, Precision.Default, FontQuality.ClearType,
                            PitchAndFamily.DefaultPitch, fontFace);
            MeasureText();
        }
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
 	        base.Init(devIf, sManager);

            // do a lookup to get y position
            float height = heightLookup.ValueLookup(0.25f, 0.25f) / maxDataValue;
            
            // load text
            text = new ScreenSpaceText(Math.Round((decimal)height * 10, 1) + "m", Color.Yellow, "Tahoma", FontWeight.Bold,
                                       11, new Vector3(0, 2.2f, 0), this);
            text.Init(devIf, sManager);
            sManager.AddEntity(text);
            AddDependant(text);

            Move(new Vector3(1.25f, height, 1.25f));
        }
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
 	        base.Init(devIf, sManager);

            BuildGeometry();
            
            axisHelper.Init(devIf, sManager);
            rotAxisHelper.Init(devIf, sManager);

            List<ISharableResource> shared = new List<ISharableResource>();
            overlayTexRz = (TextureResource)devIf.GetSharedResource("file://media/ui/vis/overlay-1s.png", ref shared);

            ShaderHLSL shader;
            if (gProfile.SupportsShaderOverlay)
            {
                shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\cpu_dem.fx");
                shader.Effect.Technique = shader.Effect.GetTechnique("LitTextured");
                defaultShader = new ShaderInterface(shader);
            }
            /*shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\cpu_dem_hClr.fx");
            shader.Effect.Technique = shader.Effect.GetTechnique("CPU_DEM_HeightClr");
            hClrShader = new ShaderInterface(shader);*/

            shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\gpu_dem.fx");
            shader.Effect.Technique = shader.Effect.GetTechnique("Basic");
            sm3Shader = new ShaderInterface(shader);
            
            /*Shape shape = ShapeContentLoader.LoadShape(gDevice, NuGenDEMVis.Properties.Resource1.VerticalPointer_Shape);
            pointerEntity = new VerticalPointerEntity(shape, rDb.Layers[0], maxDataValue);
            pointerEntity.Init(devIf, sManager);
            sManager.AddEntity(pointerEntity);*/

            /*axisHelper.Init(devIf, sManager);
            sManager.AddEntity(axisHelper);

            SetChildren(new IWorldEntity[] { axisHelper, pointerEntity });*/

            //geom.RebuildDiffuseTextures(new HeightMapDEMSampler());
        }
예제 #4
0
 public override void Init(DeviceInterface devIf, SceneManager sManager)
 {
     gDevice = devIf.Device;
 }
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            BuildRings();
        }
예제 #6
0
 public abstract void DeInit(DeviceInterface devIf, SceneManager sManager);
예제 #7
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            ray = new CustomVertex.PositionColored[2];
            ray[0] = new CustomVertex.PositionColored(start, Color.Red.ToArgb());
            ray[1] = new CustomVertex.PositionColored(end, Color.Red.ToArgb());
        }
예제 #8
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
 	        base.Init(devIf, sManager);

            vBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, gDevice, Usage.None,
                                       CustomVertex.PositionColored.Format, Pool.Managed);
            CustomVertex.PositionColored[] verts = (CustomVertex.PositionColored[])vBuffer.Lock(0, LockFlags.None);

            verts[0].Color = verts[1].Color = Color.Red.ToArgb();
            verts[1].Position = new Vector3(1, 0, 0);

            verts[2].Color = verts[3].Color = Color.Green.ToArgb();
            verts[3].Position = new Vector3(0, 1, 0);

            verts[4].Color = verts[5].Color = Color.Blue.ToArgb();
            verts[5].Position = new Vector3(0, 0, 1);

            vBuffer.Unlock();

            // build selection lines
            selectionVBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, gDevice, Usage.None,
                                                    CustomVertex.PositionColored.Format, Pool.Managed);
            verts = (CustomVertex.PositionColored[])selectionVBuffer.Lock(0, LockFlags.None);

            verts[0].Color = verts[1].Color = Color.Yellow.ToArgb();
            verts[1].Position = new Vector3(1, 0, 0);

            verts[2].Color = verts[3].Color = Color.Yellow.ToArgb();
            verts[3].Position = new Vector3(0, 1, 0);

            verts[4].Color = verts[5].Color = Color.Yellow.ToArgb();
            verts[5].Position = new Vector3(0, 0, 1);

            selectionVBuffer.Unlock();

            labels = new ScreenSpaceText[3];
            labels[0] = new ScreenSpaceText("x", Color.Red, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(1.1f, 0, 0), this);
            labels[0].Init(devIf, sManager);
            sManager.AddEntity(labels[0]);
            labels[1] = new ScreenSpaceText("y", Color.Green, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(0, 1.1f, 0), this);
            labels[1].Init(devIf, sManager);
            sManager.AddEntity(labels[1]);
            labels[2] = new ScreenSpaceText("z", Color.Blue, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(0, 0, 1.1f), this);
            labels[2].Init(devIf, sManager);
            sManager.AddEntity(labels[2]);
        }