[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
プログラミング、3DCGとその他いろいろについて
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; public class ExplosionTest : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager graphics; private BasicEffect effect; private VertexPositionColor[] vertices = { new VertexPositionColor(new Vector3(0, 0.1f, 0), Color.White), new VertexPositionColor(new Vector3(0.1f, 0, 0), Color.White), new VertexPositionColor(new Vector3(-0.1f, 0, 0), Color.White) }; private ContentManager content; public ExplosionTest() { graphics = new GraphicsDeviceManager(this); content = new ContentManager(Services); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { effect = new BasicEffect(graphics.GraphicsDevice, null); graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration( graphics.GraphicsDevice, VertexPositionColor.VertexElements ); effect.Texture = content.Load<Texture2D>("Content/explosion"); effect.TextureEnabled = true; } } protected override void UnloadGraphicsContent(bool unloadAllContent) { if (unloadAllContent) { content.Unload(); } } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); graphics.GraphicsDevice.RenderState.PointSize = 50; graphics.GraphicsDevice.RenderState.PointSpriteEnable = true; graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true; graphics.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha; graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.PointList, vertices, 0, vertices.Length ); pass.End(); } effect.End(); } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; public class ExplosionTest : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager graphics; private BasicEffect effect; private VertexPositionColor[] vertices = { new VertexPositionColor(new Vector3(0, 0.1f, 0), Color.White), new VertexPositionColor(new Vector3(0.1f, 0, 0), Color.White), new VertexPositionColor(new Vector3(-0.1f, 0, 0), Color.White) }; private ContentManager content; public ExplosionTest() { graphics = new GraphicsDeviceManager(this); content = new ContentManager(Services); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { effect = new BasicEffect(graphics.GraphicsDevice, null); graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration( graphics.GraphicsDevice, VertexPositionColor.VertexElements ); effect.Texture = content.Load<Texture2D>("Content/explosion"); effect.TextureEnabled = true; } } protected override void UnloadGraphicsContent(bool unloadAllContent) { if (unloadAllContent) { content.Unload(); } } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); graphics.GraphicsDevice.RenderState.PointSize = 50; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.PointList, vertices, 0, vertices.Length ); pass.End(); } effect.End(); } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; public class ExplosionTest : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager graphics; private BasicEffect effect; private VertexPositionColor[] vertices = { new VertexPositionColor(new Vector3(0, 0.1f, 0), Color.White), new VertexPositionColor(new Vector3(0.1f, 0, 0), Color.White), new VertexPositionColor(new Vector3(-0.1f, 0, 0), Color.White) }; private ContentManager content; public ExplosionTest() { graphics = new GraphicsDeviceManager(this); content = new ContentManager(Services); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { effect = new BasicEffect(graphics.GraphicsDevice, null); graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration( graphics.GraphicsDevice, VertexPositionColor.VertexElements ); effect.Texture = content.Load<Texture2D>("Content/explosion"); effect.TextureEnabled = true; } } protected override void UnloadGraphicsContent(bool unloadAllContent) { if (unloadAllContent) { content.Unload(); } } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); graphics.GraphicsDevice.RenderState.PointSize = 50; graphics.GraphicsDevice.RenderState.PointSpriteEnable = true; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.PointList, vertices, 0, vertices.Length ); pass.End(); } effect.End(); } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; public class ExplosionTest : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager graphics; private BasicEffect effect; private VertexPositionColor[] vertices = { new VertexPositionColor(new Vector3(0, 0.1f, 0), Color.White), new VertexPositionColor(new Vector3(0.1f, 0, 0), Color.White), new VertexPositionColor(new Vector3(-0.1f, 0, 0), Color.White) }; public ExplosionTest() { graphics = new GraphicsDeviceManager(this); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { effect = new BasicEffect(graphics.GraphicsDevice, null); graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration( graphics.GraphicsDevice, VertexPositionColor.VertexElements ); } } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); graphics.GraphicsDevice.RenderState.PointSize = 50; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.PointList, vertices, 0, vertices.Length ); pass.End(); } effect.End(); } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; public class ExplosionTest : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager graphics; private BasicEffect effect; private VertexPositionColor[] vertices = { new VertexPositionColor(new Vector3(0, 0.1f, 0), Color.White), new VertexPositionColor(new Vector3(0.1f, 0, 0), Color.White), new VertexPositionColor(new Vector3(-0.1f, 0, 0), Color.White) }; public ExplosionTest() { graphics = new GraphicsDeviceManager(this); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { effect = new BasicEffect(graphics.GraphicsDevice, null); graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration( graphics.GraphicsDevice, VertexPositionColor.VertexElements ); } } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.PointList, vertices, 0, vertices.Length ); pass.End(); } effect.End(); } }
foreach (GraphicsAdapter adapter in GraphicsAdapter.Adapters) { GraphicsDeviceCapabilities caps = adapter.GetCapabilities(DeviceType.Hardware); Window.Title += "max:" + caps.MaxPointSize; }