SlideShare a Scribd company logo
1 of 70
Download to read offline
Mohammad Shaker
mohammadshaker.com
@ZGTRShaker
2011, 2012, 2013, 2014
XNA Game Development
L04 – Primitives, IndexBuffer and VertexBuffer
3D World
3D World
3D World
Primitives
• 1 - Drawing Triangles
• 2 - A Little Practice
• 3 - Index and Vertex Buffers
• 4 - Primitive Types
Primitives
Drawing Triangles
Drawing Triangles
What do we need to draw?!
Drawing Triangles
App1-Triangles
Drawing Triangles
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
Drawing Triangles
• Global Scope
SpriteBatch spriteBatch;
VertexPositionColor[] vertices;
BasicEffect basicEffect;
Matrix world = Matrix.CreateTranslation(0, 0, 0);
Matrix view = Matrix.CreateLookAt(
new Vector3(0, 0, 3),
new Vector3(0, 0, 0),
new Vector3(0, 1, 0));
Matrix projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45),
800f / 600f,
0.01f,
100f);
Drawing Triangles
SpriteBatch spriteBatch;
VertexPositionColor[] vertices;
BasicEffect basicEffect;
Matrix world = Matrix.CreateTranslation(0, 0, 0);
Matrix view = Matrix.CreateLookAt(
new Vector3(0, 0, 3),
new Vector3(0, 0, 0),
new Vector3(0, 1, 0));
Matrix projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45),
800f / 600f,
0.01f,
100f);
Drawing Triangles
• LoadContent()
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
basicEffect = new BasicEffect(GraphicsDevice);
vertices = new VertexPositionColor[3];
vertices[0] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Red);
vertices[1] = new VertexPositionColor(new Vector3(+0.5f, 0, 0), Color.Green);
vertices[2] = new VertexPositionColor(new Vector3(-0.5f, 0, 0), Color.Blue);
}
Drawing Triangles
• LoadContent()
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
basicEffect = new BasicEffect(GraphicsDevice);
vertices = new VertexPositionColor[3];
vertices[0] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Red);
vertices[1] = new VertexPositionColor(new Vector3(+0.5f, 0, 0), Color.Green);
vertices[2] = new VertexPositionColor(new Vector3(-0.5f, 0, 0), Color.Blue);
}
Drawing Triangles
• Draw()
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.VertexColorEnabled = true;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives<VertexPositionColor>
(PrimitiveType.TriangleList, vertices, 0, 1);
}
base.Draw(gameTime);
}
Drawing Triangles
App1-Triangles
Drawing Triangles
• Cube
Different Primitive Types
Different Primitive Types
• PrimitiveType.Points
• PrimitiveType.LineList
• PrimitiveType.LineStrip
• PrimitiveType.TriangleList
• PrimitiveType.TriangleStrip
• PrimitiveType.TriangleFan
Different Primitive Types
Different Primitive Types
Different Primitive Types
Different Primitive Types
Drawing Triangles
• Using TrianglesList
• App2-Tetrahedron-TriangleList
Drawing Triangles
• How to do it with a simple
rotation?!
Drawing Triangles
• How to do it with a simple rotation?!
• First, What’s that 3D Object is?!
Tetrahedron! (Faces: 4, Vertices: 12)
Drawing Triangles
• How to do it with a simple rotation?!
• First, What’s that 3D Object is?!
Tetrahedron! (Faces: 4, Vertices: 12(Each one at a time or a one shot?!))
Drawing Triangles
• How to do it with a simple rotation?!
• First, What’s that 3D Object is?!
Tetrahedron! (Faces: 4, Vertices: 12(use TriangleList))
Drawing Triangles – Simple Rotation
• How to do it with a simple rotation?!
vertices = new VertexPositionColor[12];
vertices[0] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red);
vertices[1] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue);
vertices[2] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green);
vertices[3] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red);
vertices[4] = new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow);
vertices[5] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue);
vertices[6] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green);
vertices[7] = new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow);
vertices[8] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red);
vertices[9] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue);
vertices[10]= new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow);
vertices[11] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green);
VertexPositionColor[] vertices;
Drawing Triangles – Simple Rotation
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.VertexColorEnabled = true;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4);
}
base.Draw(gameTime);
}
Drawing Triangles – Simple Rotation
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.VertexColorEnabled = true;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4);
}
base.Draw(gameTime);
}
Drawing Triangles – Simple Rotation
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.VertexColorEnabled = true;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4);
}
base.Draw(gameTime);
}
Drawing Triangles – Simple Rotation
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.VertexColorEnabled = true;
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4);
}
base.Draw(gameTime);
}
Drawing Triangles – Rotation Logic
Drawing Triangles – Rotation Logic
Matrices and Transformations
Drawing Triangles
• Using TrianglesList
• App3-TriangleList
Different Primitive Types
• Changing last tutorial PrimitiveType to LineList will result in
• “App5-VertexBuffer-LineList”
Index And Vertex Buffers
Index And Vertex Buffers
The Concept
Index And Vertex Buffers
• Effectively store our data
• Greatly reduce the amount of data that needs to be send over to the graphics
device
– speed up our applications a looooooooooot!
• The only way to store your data
Index And Vertex Buffers
• Look at this,
Index And Vertex Buffers
True oder false?
• Look at this,
Index And Vertex Buffers
True oder false?
• Look at this,
Index And Vertex Buffers
Index And Vertex Buffers
Index And Vertex Buffers
Index And Vertex Buffers
Index And Vertex Buffers – The Creating of
• An Icosahedron
Index And Vertex Buffers – The Creating of
• An Icosahedron
• “App4-VertexBuffer”
Index And Vertex Buffers – The Creating of
• Creating the Necessary Variables
VertexBuffer vertexBuffer;
IndexBuffer indexBuffer;
Index And Vertex Buffers – The Creating of
• Creating the Necessary Variables
VertexBuffer vertexBuffer;
IndexBuffer indexBuffer;
VertexPositionColor[] vertices;
Index And Vertex Buffers – The Creating of
• Creating the Necessary Variables
VertexBuffer vertexBuffer;
IndexBuffer indexBuffer;
VertexPositionColor[] vertices; // Needed in a global scope or not?
Index And Vertex Buffers – The Creating of
• Creating the Necessary Variables
VertexBuffer vertexBuffer;
IndexBuffer indexBuffer;
VertexPositionColor[] vertices; // Needed in a global scope or not?
Index And Vertex Buffers – The Creating of
• In LoadContent()
VertexPositionColor[] vertexArray = new VertexPositionColor[12];
// vertex position and color information for icosahedron
vertexArray[0] = new VertexPositionColor(new Vector3(-0.26286500f, 0.0000000f, 0.42532500f), Color.Red);
//…..
vertexArray[11]= new VertexPositionColor(new Vector3(-0.42532500f, -0.26286500f, 0.0000000f),Color.Crimson);
// Set up the vertex buffer
vertexBuffer = new VertexBuffer( graphics.GraphicsDevice,
typeof(VertexPositionColor),
vertexArray.Length,
BufferUsage.WriteOnly);
vertexBuffer.SetData(vertexArray);
short[] indices = new short[60];
indices[0] = 0; indices[1] = 6; indices[2] = 1;
//…
indices[57] = 9; indices[58] = 11; indices[59] = 0;
indexBuffer = new IndexBuffer(graphics.GraphicsDevice, typeof(short), indices.Length, BufferUsage.WriteOnly);
indexBuffer.SetData(indices);
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• In Draw() Method
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.SetVertexBuffer(vertexBuffer);
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20);
}
Index And Vertex Buffers
• An Icosahedron at last
has been built!

More Related Content

What's hot

Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?
Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?
Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?Kazuhiro Kobayashi
 
Laravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログインLaravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログインMasashi Shinbara
 
Ruby でつくる型付き Ruby
Ruby でつくる型付き RubyRuby でつくる型付き Ruby
Ruby でつくる型付き Rubymametter
 
Introduction of WebGPU CTS
Introduction of WebGPU CTSIntroduction of WebGPU CTS
Introduction of WebGPU CTSIgalia
 
Metode pelaksanaan
Metode pelaksanaanMetode pelaksanaan
Metode pelaksanaanBetoro Guru
 
脱UniRx&Croutineから始めるUniTask
脱UniRx&Croutineから始めるUniTask脱UniRx&Croutineから始めるUniTask
脱UniRx&Croutineから始めるUniTaskEuglenaching
 
20190625 OpenACC 講習会 第3部
20190625 OpenACC 講習会 第3部20190625 OpenACC 講習会 第3部
20190625 OpenACC 講習会 第3部NVIDIA Japan
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCdisc99_
 
技術選定をしてみたというお話
技術選定をしてみたというお話技術選定をしてみたというお話
技術選定をしてみたというお話ssuser000144
 
Purely Functional Data Structures for On-Line LCA
Purely Functional Data Structures for On-Line LCAPurely Functional Data Structures for On-Line LCA
Purely Functional Data Structures for On-Line LCAEdward Kmett
 
Game Creators Conference 2019 Takashi Itai
Game Creators Conference 2019 Takashi ItaiGame Creators Conference 2019 Takashi Itai
Game Creators Conference 2019 Takashi ItaiTakashi Itai
 
altJS勉強会「Haxeすごいからみんな使え!」
altJS勉強会「Haxeすごいからみんな使え!」altJS勉強会「Haxeすごいからみんな使え!」
altJS勉強会「Haxeすごいからみんな使え!」政樹 尾野
 
Looking glass + videoplayer
Looking glass + videoplayerLooking glass + videoplayer
Looking glass + videoplayer優介 黒河
 
Kesehatan keselamatan kerja 3 KONSTRUKSI
Kesehatan keselamatan kerja 3 KONSTRUKSIKesehatan keselamatan kerja 3 KONSTRUKSI
Kesehatan keselamatan kerja 3 KONSTRUKSISeptian558020
 
Constexpr 中3女子テクニック
Constexpr 中3女子テクニックConstexpr 中3女子テクニック
Constexpr 中3女子テクニックGenya Murakami
 
型プロバイダー開発ハンズオン.pptx
型プロバイダー開発ハンズオン.pptx型プロバイダー開発ハンズオン.pptx
型プロバイダー開発ハンズオン.pptxssuserb6e6d5
 
プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話Shohei Okada
 
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話keitasudo1
 
C# における Redis 徹底活用
C# における Redis 徹底活用C# における Redis 徹底活用
C# における Redis 徹底活用Takaaki Suzuki
 

What's hot (20)

Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?
Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?
Vue 2 の EOL まで 2 ヶ月ですが進捗どうですか?
 
Laravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログインLaravel ユーザなら知っておくべきAuthオートログイン
Laravel ユーザなら知っておくべきAuthオートログイン
 
Ruby でつくる型付き Ruby
Ruby でつくる型付き RubyRuby でつくる型付き Ruby
Ruby でつくる型付き Ruby
 
Introduction of WebGPU CTS
Introduction of WebGPU CTSIntroduction of WebGPU CTS
Introduction of WebGPU CTS
 
Metode pelaksanaan
Metode pelaksanaanMetode pelaksanaan
Metode pelaksanaan
 
脱UniRx&Croutineから始めるUniTask
脱UniRx&Croutineから始めるUniTask脱UniRx&Croutineから始めるUniTask
脱UniRx&Croutineから始めるUniTask
 
20190625 OpenACC 講習会 第3部
20190625 OpenACC 講習会 第3部20190625 OpenACC 講習会 第3部
20190625 OpenACC 講習会 第3部
 
聖剣伝説3でのUE4利用事例の紹介~Making of Mana | UNREAL FEST EXTREME 2020 WINTER
聖剣伝説3でのUE4利用事例の紹介~Making of Mana | UNREAL FEST EXTREME 2020 WINTER聖剣伝説3でのUE4利用事例の紹介~Making of Mana | UNREAL FEST EXTREME 2020 WINTER
聖剣伝説3でのUE4利用事例の紹介~Making of Mana | UNREAL FEST EXTREME 2020 WINTER
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPC
 
技術選定をしてみたというお話
技術選定をしてみたというお話技術選定をしてみたというお話
技術選定をしてみたというお話
 
Purely Functional Data Structures for On-Line LCA
Purely Functional Data Structures for On-Line LCAPurely Functional Data Structures for On-Line LCA
Purely Functional Data Structures for On-Line LCA
 
Game Creators Conference 2019 Takashi Itai
Game Creators Conference 2019 Takashi ItaiGame Creators Conference 2019 Takashi Itai
Game Creators Conference 2019 Takashi Itai
 
altJS勉強会「Haxeすごいからみんな使え!」
altJS勉強会「Haxeすごいからみんな使え!」altJS勉強会「Haxeすごいからみんな使え!」
altJS勉強会「Haxeすごいからみんな使え!」
 
Looking glass + videoplayer
Looking glass + videoplayerLooking glass + videoplayer
Looking glass + videoplayer
 
Kesehatan keselamatan kerja 3 KONSTRUKSI
Kesehatan keselamatan kerja 3 KONSTRUKSIKesehatan keselamatan kerja 3 KONSTRUKSI
Kesehatan keselamatan kerja 3 KONSTRUKSI
 
Constexpr 中3女子テクニック
Constexpr 中3女子テクニックConstexpr 中3女子テクニック
Constexpr 中3女子テクニック
 
型プロバイダー開発ハンズオン.pptx
型プロバイダー開発ハンズオン.pptx型プロバイダー開発ハンズオン.pptx
型プロバイダー開発ハンズオン.pptx
 
プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話
 
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話
WCFのパイプ通信を .NET 5に向けてgRPCへ置き換える話
 
C# における Redis 徹底活用
C# における Redis 徹底活用C# における Redis 徹底活用
C# における Redis 徹底活用
 

Viewers also liked

Ogdc 2013 2d artist the first steps
Ogdc 2013 2d artist the first stepsOgdc 2013 2d artist the first steps
Ogdc 2013 2d artist the first stepsSon Aris
 
XNA L06–Input, Audio and Video Playback
XNA L06–Input, Audio and Video PlaybackXNA L06–Input, Audio and Video Playback
XNA L06–Input, Audio and Video PlaybackMohammad Shaker
 
XNA L11–Shaders Part 2
XNA L11–Shaders Part 2XNA L11–Shaders Part 2
XNA L11–Shaders Part 2Mohammad Shaker
 
XNA L08–Amazing XNA Utilities
XNA L08–Amazing XNA UtilitiesXNA L08–Amazing XNA Utilities
XNA L08–Amazing XNA UtilitiesMohammad Shaker
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1Mohammad Shaker
 
XNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainXNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainMohammad Shaker
 

Viewers also liked (7)

Ogdc 2013 2d artist the first steps
Ogdc 2013 2d artist the first stepsOgdc 2013 2d artist the first steps
Ogdc 2013 2d artist the first steps
 
XNA L06–Input, Audio and Video Playback
XNA L06–Input, Audio and Video PlaybackXNA L06–Input, Audio and Video Playback
XNA L06–Input, Audio and Video Playback
 
XNA L11–Shaders Part 2
XNA L11–Shaders Part 2XNA L11–Shaders Part 2
XNA L11–Shaders Part 2
 
XNA L01–Introduction
XNA L01–IntroductionXNA L01–Introduction
XNA L01–Introduction
 
XNA L08–Amazing XNA Utilities
XNA L08–Amazing XNA UtilitiesXNA L08–Amazing XNA Utilities
XNA L08–Amazing XNA Utilities
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1
 
XNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainXNA L07–Skybox and Terrain
XNA L07–Skybox and Terrain
 

Similar to XNA Game Development L04 - Index and Vertex Buffers

XNA L09–2D Graphics and Particle Engines
XNA L09–2D Graphics and Particle EnginesXNA L09–2D Graphics and Particle Engines
XNA L09–2D Graphics and Particle EnginesMohammad Shaker
 
XNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsXNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsMohammad Shaker
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3Droxlu
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2StanfordComputationalImaging
 
XNA L03–Models, Basic Effect and Animation
XNA L03–Models, Basic Effect and AnimationXNA L03–Models, Basic Effect and Animation
XNA L03–Models, Basic Effect and AnimationMohammad Shaker
 
C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 Mohammad Shaker
 
Im looking for coding help I dont really need this to be explained.pdf
Im looking for coding help I dont really need this to be explained.pdfIm looking for coding help I dont really need this to be explained.pdf
Im looking for coding help I dont really need this to be explained.pdfcontact41
 
OpenGLES Android Graphics
OpenGLES Android GraphicsOpenGLES Android Graphics
OpenGLES Android GraphicsArvind Devaraj
 
3D Math Without Presenter Notes
3D Math Without Presenter Notes3D Math Without Presenter Notes
3D Math Without Presenter NotesJanie Clayton
 
Adventures In Data Compilation
Adventures In Data CompilationAdventures In Data Compilation
Adventures In Data CompilationNaughty Dog
 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Mark Kilgard
 
Creating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChartCreating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChartDavid Keener
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf AtlantaJanie Clayton
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf ChicagoJanie Clayton
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .netStephen Lorello
 

Similar to XNA Game Development L04 - Index and Vertex Buffers (20)

XNA L09–2D Graphics and Particle Engines
XNA L09–2D Graphics and Particle EnginesXNA L09–2D Graphics and Particle Engines
XNA L09–2D Graphics and Particle Engines
 
XNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsXNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and Transformations
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3D
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
 
XNA L03–Models, Basic Effect and Animation
XNA L03–Models, Basic Effect and AnimationXNA L03–Models, Basic Effect and Animation
XNA L03–Models, Basic Effect and Animation
 
C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1
 
Im looking for coding help I dont really need this to be explained.pdf
Im looking for coding help I dont really need this to be explained.pdfIm looking for coding help I dont really need this to be explained.pdf
Im looking for coding help I dont really need this to be explained.pdf
 
OpenGLES Android Graphics
OpenGLES Android GraphicsOpenGLES Android Graphics
OpenGLES Android Graphics
 
HTML5 Canvas
HTML5 CanvasHTML5 Canvas
HTML5 Canvas
 
3D Math Without Presenter Notes
3D Math Without Presenter Notes3D Math Without Presenter Notes
3D Math Without Presenter Notes
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
Adventures In Data Compilation
Adventures In Data CompilationAdventures In Data Compilation
Adventures In Data Compilation
 
Real life XNA
Real life XNAReal life XNA
Real life XNA
 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well
 
Creating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChartCreating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChart
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
 
ChainerX and How to Take Part
ChainerX and How to Take PartChainerX and How to Take Part
ChainerX and How to Take Part
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .net
 

More from Mohammad Shaker

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian GraduateMohammad Shaker
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Mohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyMohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015Mohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game DevelopmentMohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesMohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - ColorMohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - TypographyMohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingMohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and ThreadingMohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSMohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsMohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsMohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and GamingMohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / ParseMohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesMohammad Shaker
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes Mohammad Shaker
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and AdaptersMohammad Shaker
 

More from Mohammad Shaker (20)

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

XNA Game Development L04 - Index and Vertex Buffers

  • 1. Mohammad Shaker mohammadshaker.com @ZGTRShaker 2011, 2012, 2013, 2014 XNA Game Development L04 – Primitives, IndexBuffer and VertexBuffer
  • 5. Primitives • 1 - Drawing Triangles • 2 - A Little Practice • 3 - Index and Vertex Buffers • 4 - Primitive Types
  • 8. Drawing Triangles What do we need to draw?!
  • 11. Drawing Triangles • Global Scope SpriteBatch spriteBatch; VertexPositionColor[] vertices; BasicEffect basicEffect; Matrix world = Matrix.CreateTranslation(0, 0, 0); Matrix view = Matrix.CreateLookAt( new Vector3(0, 0, 3), new Vector3(0, 0, 0), new Vector3(0, 1, 0)); Matrix projection = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45), 800f / 600f, 0.01f, 100f);
  • 12. Drawing Triangles SpriteBatch spriteBatch; VertexPositionColor[] vertices; BasicEffect basicEffect; Matrix world = Matrix.CreateTranslation(0, 0, 0); Matrix view = Matrix.CreateLookAt( new Vector3(0, 0, 3), new Vector3(0, 0, 0), new Vector3(0, 1, 0)); Matrix projection = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45), 800f / 600f, 0.01f, 100f);
  • 13. Drawing Triangles • LoadContent() protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); basicEffect = new BasicEffect(GraphicsDevice); vertices = new VertexPositionColor[3]; vertices[0] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Red); vertices[1] = new VertexPositionColor(new Vector3(+0.5f, 0, 0), Color.Green); vertices[2] = new VertexPositionColor(new Vector3(-0.5f, 0, 0), Color.Blue); }
  • 14. Drawing Triangles • LoadContent() protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); basicEffect = new BasicEffect(GraphicsDevice); vertices = new VertexPositionColor[3]; vertices[0] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Red); vertices[1] = new VertexPositionColor(new Vector3(+0.5f, 0, 0), Color.Green); vertices[2] = new VertexPositionColor(new Vector3(-0.5f, 0, 0), Color.Blue); }
  • 15. Drawing Triangles • Draw() protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); basicEffect.World = world; basicEffect.View = view; basicEffect.Projection = projection; basicEffect.VertexColorEnabled = true; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives<VertexPositionColor> (PrimitiveType.TriangleList, vertices, 0, 1); } base.Draw(gameTime); }
  • 19. Different Primitive Types • PrimitiveType.Points • PrimitiveType.LineList • PrimitiveType.LineStrip • PrimitiveType.TriangleList • PrimitiveType.TriangleStrip • PrimitiveType.TriangleFan
  • 24. Drawing Triangles • Using TrianglesList • App2-Tetrahedron-TriangleList
  • 25. Drawing Triangles • How to do it with a simple rotation?!
  • 26. Drawing Triangles • How to do it with a simple rotation?! • First, What’s that 3D Object is?! Tetrahedron! (Faces: 4, Vertices: 12)
  • 27. Drawing Triangles • How to do it with a simple rotation?! • First, What’s that 3D Object is?! Tetrahedron! (Faces: 4, Vertices: 12(Each one at a time or a one shot?!))
  • 28. Drawing Triangles • How to do it with a simple rotation?! • First, What’s that 3D Object is?! Tetrahedron! (Faces: 4, Vertices: 12(use TriangleList))
  • 29. Drawing Triangles – Simple Rotation • How to do it with a simple rotation?! vertices = new VertexPositionColor[12]; vertices[0] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red); vertices[1] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue); vertices[2] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green); vertices[3] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red); vertices[4] = new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow); vertices[5] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue); vertices[6] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green); vertices[7] = new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow); vertices[8] = new VertexPositionColor(new Vector3(0.000f, 1.000f, 0.000f), Color.Red); vertices[9] = new VertexPositionColor(new Vector3(-0.816f, -0.333f, -0.471f), Color.Blue); vertices[10]= new VertexPositionColor(new Vector3(0.816f, -0.333f, -0.471f), Color.Yellow); vertices[11] = new VertexPositionColor(new Vector3(0.000f, -0.333f, 0.943f), Color.Green); VertexPositionColor[] vertices;
  • 30. Drawing Triangles – Simple Rotation protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); basicEffect.World = world; basicEffect.View = view; basicEffect.Projection = projection; basicEffect.VertexColorEnabled = true; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4); } base.Draw(gameTime); }
  • 31. Drawing Triangles – Simple Rotation protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); basicEffect.World = world; basicEffect.View = view; basicEffect.Projection = projection; basicEffect.VertexColorEnabled = true; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4); } base.Draw(gameTime); }
  • 32. Drawing Triangles – Simple Rotation protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); basicEffect.World = world; basicEffect.View = view; basicEffect.Projection = projection; basicEffect.VertexColorEnabled = true; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4); } base.Draw(gameTime); }
  • 33. Drawing Triangles – Simple Rotation protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); basicEffect.World = world; basicEffect.View = view; basicEffect.Projection = projection; basicEffect.VertexColorEnabled = true; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 4); } base.Draw(gameTime); }
  • 34. Drawing Triangles – Rotation Logic
  • 35. Drawing Triangles – Rotation Logic Matrices and Transformations
  • 36. Drawing Triangles • Using TrianglesList • App3-TriangleList
  • 37. Different Primitive Types • Changing last tutorial PrimitiveType to LineList will result in • “App5-VertexBuffer-LineList”
  • 38. Index And Vertex Buffers
  • 39. Index And Vertex Buffers The Concept
  • 40. Index And Vertex Buffers • Effectively store our data • Greatly reduce the amount of data that needs to be send over to the graphics device – speed up our applications a looooooooooot! • The only way to store your data
  • 41. Index And Vertex Buffers • Look at this,
  • 42. Index And Vertex Buffers True oder false? • Look at this,
  • 43. Index And Vertex Buffers True oder false? • Look at this,
  • 44. Index And Vertex Buffers
  • 45. Index And Vertex Buffers
  • 46. Index And Vertex Buffers
  • 47. Index And Vertex Buffers
  • 48. Index And Vertex Buffers – The Creating of • An Icosahedron
  • 49. Index And Vertex Buffers – The Creating of • An Icosahedron • “App4-VertexBuffer”
  • 50. Index And Vertex Buffers – The Creating of • Creating the Necessary Variables VertexBuffer vertexBuffer; IndexBuffer indexBuffer;
  • 51. Index And Vertex Buffers – The Creating of • Creating the Necessary Variables VertexBuffer vertexBuffer; IndexBuffer indexBuffer; VertexPositionColor[] vertices;
  • 52. Index And Vertex Buffers – The Creating of • Creating the Necessary Variables VertexBuffer vertexBuffer; IndexBuffer indexBuffer; VertexPositionColor[] vertices; // Needed in a global scope or not?
  • 53. Index And Vertex Buffers – The Creating of • Creating the Necessary Variables VertexBuffer vertexBuffer; IndexBuffer indexBuffer; VertexPositionColor[] vertices; // Needed in a global scope or not?
  • 54. Index And Vertex Buffers – The Creating of • In LoadContent() VertexPositionColor[] vertexArray = new VertexPositionColor[12]; // vertex position and color information for icosahedron vertexArray[0] = new VertexPositionColor(new Vector3(-0.26286500f, 0.0000000f, 0.42532500f), Color.Red); //….. vertexArray[11]= new VertexPositionColor(new Vector3(-0.42532500f, -0.26286500f, 0.0000000f),Color.Crimson); // Set up the vertex buffer vertexBuffer = new VertexBuffer( graphics.GraphicsDevice, typeof(VertexPositionColor), vertexArray.Length, BufferUsage.WriteOnly); vertexBuffer.SetData(vertexArray); short[] indices = new short[60]; indices[0] = 0; indices[1] = 6; indices[2] = 1; //… indices[57] = 9; indices[58] = 11; indices[59] = 0; indexBuffer = new IndexBuffer(graphics.GraphicsDevice, typeof(short), indices.Length, BufferUsage.WriteOnly); indexBuffer.SetData(indices);
  • 55. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 56. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 57. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 58. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 59. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 60. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 61. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 62.
  • 63. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 64. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 65. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 66. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 67. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 68. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 69. Index And Vertex Buffers • In Draw() Method foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.SetVertexBuffer(vertexBuffer); graphics.GraphicsDevice.Indices = indexBuffer; graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 12, 0, 20); }
  • 70. Index And Vertex Buffers • An Icosahedron at last has been built!