private void CreateCubes() { double ii = 0; double jj = 0; for (int i = -3; i < 4; i++) { for (int j = -3; j < 4; j++) { TextureQuad cube; if (i % 2 == 0) { cube = new TextureQuad(this.blueTexture); cube.Position = new Vector3(3 * i, 1, 3 * j); cube.StartAfterSeconds = ii + jj; } else { cube = new TextureQuad(this.greenTexture); cube.Position = new Vector3(3 * i, 1, 3 * j); cube.StartAfterSeconds = ii + jj; } this.TextureQuads.Add(cube); jj += 0.5; } jj = 0; ii += 0.5; } }
public ExplosionEngine(GraphicsDevice device, Texture2D[] explosionArray, int size, int smallSize) { _textureQuad = new TextureQuad(device, explosionArray, size, size); _smallTextureQuad = new TextureQuad(device, explosionArray, smallSize, smallSize); _explosionList = new List<Explosion>(); _maxIndex = explosionArray.Count(); _device = device; }
public Form3DView() : base(ID) { base.IsOpenReflectsVisiblity = true; InitializeComponent(); LoadOpenGLControl(); imuModel = LoadModel("PCB", this.imuHousingToolStripMenuItem.Checked ? housingModelPath : pcbModelPath, true); axisModel = LoadModel("Axis", "~/3DView/Arrow.obj", false); floorTileModel = LoadModel("Floor Tile", floorTileModelPath, false); material = new SimpleTexturedMaterial(false); effects.Effects.Add(material.Name, material); tileMaterial = new SimpleTexturedMaterial(true); effects.Effects.Add(tileMaterial.Name, tileMaterial); effects.Effects.Add(SimpleTexturedQuad.GetName(BoxMode.Color), new SimpleTexturedQuad(BoxMode.Color)); effects.Effects.Add(SimpleTexturedQuad.GetName(BoxMode.Textured), new SimpleTexturedQuad(BoxMode.Textured)); effects.Effects.Add(SimpleTexturedQuad.GetName(BoxMode.TexturedColor), new SimpleTexturedQuad(BoxMode.TexturedColor)); textRenderer = new TextRenderer(10, 10); texturedQuad = new TextureQuad(effects); texturedQuad.Texture = textRenderer.Texture; view = new View3D(glControl1.Bounds, glControl1.Bounds.Width, glControl1.Bounds.Height, (float)Math.PI / 4f); int lightCount = 1; //lightBuffer = new UniformBuffer("Lights", new UniformBufferInfo(ModelLightInstance.Format, 1, OpenTK.Graphics.OpenGL.BufferUsageHint.DynamicDraw)); lights = new ModelLightInstance[lightCount]; sceneLights = new ModelSceneLight[lightCount]; sceneLights[0] = new ModelSceneLight() { Center = new OpenTK.Vector3(30, 80, 60) * 8000f, Color = Color4.White, SpecularPower = 1.2f, Radius = float.PositiveInfinity, AttenuatuionTermA = 0f, Intensity = 0.8f, Directional = true, }; lightingArguments = new LightingArguments(); Quaternion = NgimuApi.Maths.Quaternion.Identity; formUpdateTimer = new Timer(); formUpdateTimer.Interval = 20; formUpdateTimer.Tick += new EventHandler(formUpdateTimer_Tick); tileTexture = new BitmapTexture2D("Tile Texture", "~/3DView/Compass.png", Texture2DInfo.Bitmap32_LinearClampToEdgeMipAnisotropicFilteringX4(new Size(32, 32))); }
public ParticleEngine(GraphicsDevice device, int maxParticles, Vector3 Plypos, Quaternion Plyrotation, Texture2D[] textureArray, float width) { _device = device; _particleList = new List<Particle>(); _randVar = new Random(); amtTextures = textureArray.Length; _textureQuad = new TextureQuad(device, textureArray, width, width); for (int i = 0; i < maxParticles; i++) { _particleList.Add(new Particle(Plypos, Plyrotation, (float)_randVar.NextDouble())); } }
public ShipOverlay(Texture2D image, GraphicsDevice device, float size) { _textureQuad = new TextureQuad(device, image, size, size); }
public Sun(GraphicsDevice device, Texture2D sunTexture, Vector3 position, int size) { _textureQuad = new TextureQuad(device, sunTexture, size, size); Position = position; _device = device; }