コード例 #1
0
        public void Initialize(Device1 device, RenderTargetView renderTarget, DX10RenderCanvas canvasControl)
        {
            Context.Camera           = new OrbitCamera(canvasControl);
            Context.Device           = device;
            Context.RenderControl    = canvasControl;
            Context.RenderTargetView = renderTarget;

            _grid = new Grid();
            _grid.Initialize(Context);

            MeshRenderer = new MeshRenderer(Context);
            MeshRenderer.Initialize();

            PhysicsDebugRenderer = new PhysicsDebugRenderer(Context);
            PhysicsDebugRenderer.Initialize();

            DebugLog.Log($"Initialized", "Viewport");
        }
コード例 #2
0
        public void Initialize(Device1 device, RenderTargetView renderTarget, DX10RenderCanvas canvasControl)
        {
            _device                   = device;
            _renderTargetView         = renderTarget;
            _renderControl            = canvasControl;
            _renderControl.ClearColor = Color.CornflowerBlue;
            _renderControl.OnDrop    += OnDrop;

            //Set Shader (IEffect)
            Shader = new PosColorNormSkinnedEffect();
            Shader.Create(device);

            Camera = new BaseCamera();
            Camera = new FlyingCamera();

            if (OnLoad != null)
            {
                OnLoad();
            }
        }
コード例 #3
0
        public void Initialize(Device1 device, RenderTargetView renderTarget, DX10RenderCanvas canvasControl)
        {
            _device           = device;
            _renderTargetView = renderTarget;
            _renderControl    = canvasControl;


            //Set Model (IModel)
            // Model = new BoxModel();
            //Model.Create(_device);
            var filepath = System.AppDomain.CurrentDomain.BaseDirectory;

            filepath += "\\Resources\\Model\\MinecraftModel.obj";
            Model     = new AssimpModel(filepath);
            Model.Create(_device);
            //Set Shader (IEffect)
            Shader = new PosNormTex();
            Shader.Create(device);
            //Shader.SetTexture("C:\\Users\\NielsR\\Documents\\DAE 2016-2017\\TOOL DEVELOPMENT\\Week_11_-_DirectX_Image_Control\\d\\DirextXFirstProject\\ Minecraft_skin_editor\\scichart-surface-mesh-8x8-3d-300x187.png", _device);
        }
コード例 #4
0
        public void Initialize(Device1 device, RenderTargetView renderTarget, DX10RenderCanvas canvasControl)
        {
            //Create the graphics context
            GraphicsContext.Device           = device;
            GraphicsContext.RenderTargetView = renderTarget;
            GraphicsContext.RenderControl    = canvasControl;
            OrbitCamera camera = new OrbitCamera(canvasControl);

            camera.ResetAngles = new Vector3(-MathUtil.PiOverFour, -MathUtil.PiOverFour, 0);
            camera.Reset();
            GraphicsContext.Camera = camera;

            //Grid
            _grid = new Grid();
            _grid.Initialize(GraphicsContext);

            ParticleEmitter = new ParticleEmitter(GraphicsContext);
            ParticleEmitter.Intialize();

            DebugLog.Log("Initialized", "Direct3D");
        }
コード例 #5
0
        public void Initialize(Device1 device, RenderTargetView renderTarget, DX10RenderCanvas canvasControl)
        {
            if (_isInitialized)
            {
                return;
            }
            _device           = device;
            _renderTargetView = renderTarget;
            _renderControl    = canvasControl;

            if (Shader == null)
            {
                LoadShader(@"./Shaders/PosColNorm3D.fx");
            }

            if (Model == null)
            {
                LoadModel(@"./Models/teapot.fbx");
            }

            _isInitialized = true;
        }
コード例 #6
0
 public OrbitCamera(DX10RenderCanvas canvasControl)
 {
     _canvasControl = canvasControl;
     Reset();
     DebugLog.Log("Camera initialized", "Camera");
 }
コード例 #7
0
 public OrbitCamera(DX10RenderCanvas canvasControl)
 {
     _canvasControl = canvasControl;
     Reset();
 }