We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 27 January 2011 - 11:40 AM
Posted 27 January 2011 - 12:38 PM
#region Left Rectangle // top left position = new Vertex3(-1, 1, 1); textureCoordinates = new Vector2(0,0); vertices[0] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom right position = new Vertex3(-1, 1, 0); textureCoordinates = new Vector2(1,1); vertices[1] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom left position = new Vertex3(-1, -1, 1); textureCoordinates = new Vector2(0,1); vertices[2] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // top right position = new Vertex3(-1, 1, 0); textureCoordinates = new Vector2(1,0); vertices[3] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); #endregion #region Middle rectangle // top left position = new Vertex3(-1, 1, 0); textureCoordinates = new Vector2(0,0); vertices[4] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom right position = new Vertex3(1, 1, 0); textureCoordinates = new Vector2(1,1); vertices[5] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom left position = new Vertex3(-1, -1, 0); textureCoordinates = new Vector2(0,1); vertices[6] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // top right position = new Vertex3(1, 1, 0); textureCoordinates = new Vector2(1,0); vertices[7] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); #endregion #region right rectangle // top left position = new Vertex3(1, 1, 1); textureCoordinates = new Vector2(0,0); vertices[8] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom right position = new Vertex3(1, -1, 1); textureCoordinates = new Vector2(1,1); vertices[9] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // bottom left position = new Vertex3(1, -1, 0); textureCoordinates = new Vector2(0,1); vertices[10] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); // top right position = new Vertex3(1, 1, 1); textureCoordinates = new Vector2(1,0); vertices[11] = new VertexPositionNormalTexture(position, Vector3.Forward, textureCoordinates); #endregion
indices = new short[18]; // left (bottom) indices[0] = 0; // top left indices[1] = 1; // bottom right indices[2] = 2; // bottom left // left (top) indices[3] = 0; // top left indices[4] = 3; // top right indices[5] = 1; // bottom right // middle (bottom) indices[6] = 3; // top left indices[7] = 4; // bottom right indices[8] = 1; // bottom left // middle (top) indices[9] = 3; // top left indices[10] = 5; // top right indices[11] = 4; // bottom right // right (bottom) indices[12] = 5; // top left indices[13] = 6; // bottom right indices[14] = 4; // bottom left // right (top) indices[15] = 5; // top left indices[16] = 7; // top right indices[17] = 6; // bottom right
Posted 28 January 2011 - 07:42 AM
Posted 28 January 2011 - 08:36 AM
Posted 28 January 2011 - 08:43 AM
Posted 28 January 2011 - 10:21 AM
Posted 28 January 2011 - 10:29 AM
Posted 28 January 2011 - 11:25 AM
Posted 28 January 2011 - 12:46 PM
vertices[0] = new VertexPositionNormalTexture(new Vector3(-3, -1, 0), Vector3.Forward, new Vector2(0, 0)); vertices[1] = new VertexPositionNormalTexture(new Vector3(-3, 1, 0), Vector3.Forward, new Vector2(0, 1)); vertices[2] = new VertexPositionNormalTexture(new Vector3(-1, -1, 0), Vector3.Forward, new Vector2(1, 0)); vertices[3] = new VertexPositionNormalTexture(new Vector3(-1, 1, 0), Vector3.Forward, new Vector2(1, 1)); vertices[4] = new VertexPositionNormalTexture(new Vector3(1, -1, 0), Vector3.Forward, new Vector2(0, 0)); vertices[5] = new VertexPositionNormalTexture(new Vector3(1, 1, 0), Vector3.Forward, new Vector2(0, 1)); vertices[6] = new VertexPositionNormalTexture(new Vector3(3, -1, 0), Vector3.Forward, new Vector2(1, 0)); vertices[7] = new VertexPositionNormalTexture(new Vector3(3, 1, 0), Vector3.Forward, new Vector2(1, 1));
indices[0] = 0; indices[1] = 1; indices[2] = 2; indices[3] = 1; indices[4] = 3; indices[5] = 2; indices[6] = 2; indices[7] = 3; indices[8] = 4; indices[9] = 3; indices[10] = 5; indices[11] = 4; indices[12] = 4; indices[13] = 5; indices[14] = 6; indices[15] = 5; indices[16] = 7; indices[17] = 6;
Posted 28 January 2011 - 12:52 PM
indices[0] = 0; indices[1] = 1; indices[2] = 2; indices[3] = 3;
Posted 28 January 2011 - 01:29 PM
Posted 31 January 2011 - 07:29 AM
Hmm, that's pretty much the code i ended up with after I made the changes. I think I may have forgotten to update the vertex or index buffer though. Maybe that's why it wasn't showing up right.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.