public void DrawCylinderTrigger(Matrix world, bool isSelected) { cylinderRenderData.worldViewProjection = world * viewProjection; if (isSelected) { cylinderRenderData.Color = selectedColor; } else { cylinderRenderData.Color = normalColor; } Device.SetFillModeDefault(); Device.SetCullModeNone(); Device.SetBlendStateAlphaBlend(); Device.ApplyRasterState(); Device.UpdateAllStates(); Device.UpdateData(basicBuffer, cylinderRenderData); Device.DeviceContext.VertexShader.SetConstantBuffer(0, basicBuffer); basicShader.Apply(); Cylinder.Draw(Device); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(SkyColor); GraphicsDevice.BlendState = BlendState.AlphaBlend; GraphicsDevice.DepthStencilState = DepthStencilState.Default; GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; if (wireframeMode) { RasterizerState rasterizerState = new RasterizerState(); rasterizerState.FillMode = FillMode.WireFrame; GraphicsDevice.RasterizerState = rasterizerState; } else { GraphicsDevice.RasterizerState = RasterizerState.CullNone; } light.Draw(GraphicsDevice, Camera); teapot.Draw(GraphicsDevice, Camera); //cube.Draw(GraphicsDevice, Camera); geomCube.Draw(GraphicsDevice, Camera); geomCylinder.Draw(GraphicsDevice, Camera); geomSphere.Draw(GraphicsDevice, Camera); geomTorus.Draw(GraphicsDevice, Camera); floor.Draw(GraphicsDevice, Camera); DrawGrid(); DrawDebugOverlay(); Console.Draw(spriteBatch); base.Draw(gameTime); }
private void Start() { DirectX dx = new DirectX(); Sphere s = new Sphere(dx); s.Draw(); Cube c = new Cube(dx); c.Draw(); OpenGL ogl = new OpenGL(); Cylinder cy = new Cylinder(ogl); cy.Draw(); }
public void DrawCylinder(Matrix world, bool isSelected, Vector4 normalColor) { if (AssetMODL.renderBasedOnLodt && Vector3.Distance(Camera.Position, (Vector3)world.Row4) > 100f) { return; } renderData.worldViewProjection = world * viewProjection; renderData.Color = isSelected ? selectedColor : normalColor; device.UpdateData(basicBuffer, renderData); device.DeviceContext.VertexShader.SetConstantBuffer(0, basicBuffer); basicShader.Apply(); Cylinder.Draw(device); }
public void DrawCylinder(Matrix world, bool isSelected, Vector4 normalColor) { renderData.worldViewProjection = world * viewProjection; renderData.Color = isSelected ? selectedColor : normalColor; device.SetCullModeNone(); device.ApplyRasterState(); device.SetBlendStateAlphaBlend(); device.UpdateAllStates(); device.UpdateData(basicBuffer, renderData); device.DeviceContext.VertexShader.SetConstantBuffer(0, basicBuffer); basicShader.Apply(); Cylinder.Draw(device); }