Jump to content
  • Advertisement

ReyLith

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

105 Neutral

About ReyLith

  • Rank
    Newbie
  1. I have moved the post to the DirectX and XNA section. Sorry. http://www.gamedev.net/topic/640722-xna-doesnt-sometimes-draw-properly-moved/
  2. Hi,   I am developing an 3D platformer game with XNA framework and I am experimenting some errors in drawing. Here is some images of the errors, that appears in 3D models and in planes:        In the first image, all the plane should be with the gray texture. In the second image shouldn't appear the errors. The code that I am using to load the vertices and textures is the next:   // CODE INCLUDED IN LOAD() METHOD Vector3 left = Vector3.Cross(_normal, _up); Vector3 lowerLeft, upperLeft, lowerRight, upperRight; for (int i = 0; i < _rows; i++) { for (int j = 0; j < _cols; j++) { if (information[i + 5, j] != "Null") { string[] aux = information[i + 5, j].Split('_'); lowerLeft = _origin + (_up * i); lowerLeft += -left * j; lowerLeft += -left * ToInt(aux[1][0]); upperLeft = lowerLeft + (_up * ToInt(aux[1][1])); lowerRight = lowerLeft + (left * ToInt(aux[1][0])); upperRight = lowerRight + (_up * ToInt(aux[1][1])); _vertices.Add(new VertexPositionNormalTexture( lowerRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 1))); _vertices.Add(new VertexPositionNormalTexture(upperRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 0))); _vertices.Add(new VertexPositionNormalTexture(lowerLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 1))); _vertices.Add(new VertexPositionNormalTexture(upperRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 0))); _vertices.Add(new VertexPositionNormalTexture(upperLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 0))); _vertices.Add(new VertexPositionNormalTexture(lowerLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 1))); } } } _tileVertexBuffer = new DynamicVertexBuffer(EngineManager.GameGraphicsDevice, VertexPositionNormalTexture.VertexDeclaration, _rows * _cols * 6, BufferUsage.WriteOnly);   The code used to draw the vertices is the next:   // CODE INCLUDED IN DRAW() METHOD _tileVertexBuffer.SetData<VertexPositionNormalTexture>(_vertices.ToArray()); _effect.View = CameraManager.ActiveCamera.View; _effect.Projection = CameraManager.ActiveCamera.Projection; _effect.Texture = TextureManager.GetTexture(_textureName).BaseTexture; _effect.DiffuseColor = Color.LightBlue.ToVector3(); foreach (EffectPass pass in _effect.CurrentTechnique.Passes) { pass.Apply(); EngineManager.GameGraphicsDevice.SetVertexBuffer(_tileVertexBuffer); EngineManager.GameGraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, _tileVertexBuffer.VertexCount / 3); } EngineManager.GameGraphicsDevice.SetVertexBuffer(null); I am not using an index buffer to draw the plane and I don't know if this is the problem. I have spent a long time surfing on Internet but I can't find a similar problem. Thanks in advance.   PD: Sorry for my english level.
  3. Hi,   I am developing an 3D platformer game with XNA framework and I am experimenting some errors in drawing. Here is some images of the errors, that appears in 3D models and in planes:       In the first image, all the plane should be with the gray texture. In the second image shouldn't appear the errors. The code that I am using to load the vertices and textures is the next:   // CODE INCLUDED IN LOAD() METHOD Vector3 left = Vector3.Cross(_normal, _up); Vector3 lowerLeft, upperLeft, lowerRight, upperRight; for (int i = 0; i < _rows; i++) { for (int j = 0; j < _cols; j++) { if (information[i + 5, j] != "Null") { string[] aux = information[i + 5, j].Split('_'); lowerLeft = _origin + (_up * i); lowerLeft += -left * j; lowerLeft += -left * ToInt(aux[1][0]); upperLeft = lowerLeft + (_up * ToInt(aux[1][1])); lowerRight = lowerLeft + (left * ToInt(aux[1][0])); upperRight = lowerRight + (_up * ToInt(aux[1][1])); _vertices.Add(new VertexPositionNormalTexture( lowerRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 1))); _vertices.Add(new VertexPositionNormalTexture( upperRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 0))); _vertices.Add(new VertexPositionNormalTexture( lowerLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 1))); _vertices.Add(new VertexPositionNormalTexture( upperRight, _normal, new Vector2((1.0f / _numberOfTiles) * (Convert.ToInt32(aux[0]) - 1), 0))); _vertices.Add(new VertexPositionNormalTexture( upperLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 0))); _vertices.Add(new VertexPositionNormalTexture( lowerLeft, _normal, new Vector2((1.0f / _numberOfTiles) * Convert.ToInt32(aux[0]), 1))); } } } _tileVertexBuffer = new DynamicVertexBuffer(EngineManager.GameGraphicsDevice, VertexPositionNormalTexture.VertexDeclaration, _rows * _cols * 6, BufferUsage.WriteOnly);   The code used to draw the vertices is the next:   // CODE INCLUDED IN DRAW() METHOD _tileVertexBuffer.SetData<VertexPositionNormalTexture>(_vertices.ToArray()); _effect.View = CameraManager.ActiveCamera.View; _effect.Projection = CameraManager.ActiveCamera.Projection; _effect.Texture = TextureManager.GetTexture(_textureName).BaseTexture; _effect.DiffuseColor = Color.LightBlue.ToVector3(); foreach (EffectPass pass in _effect.CurrentTechnique.Passes) { pass.Apply(); EngineManager.GameGraphicsDevice.SetVertexBuffer(_tileVertexBuffer); EngineManager.GameGraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, _tileVertexBuffer.VertexCount / 3); } EngineManager.GameGraphicsDevice.SetVertexBuffer(null);   I am not using an index buffer to draw the plane and I don't know if this is the problem. I have spent a long time surfing on Internet but I can't find a similar problem. Thanks in advance.   PD: Sorry for my english level.
  4. ReyLith

    Beginner in game programming

    Hi, I had thought to develop two or three levels since I may be going a long time to learn the graphic engine. The reason I want to develop a game is because I like to work in the sector. So I want to work with an engine that I can serve as experience. First I thought in CryEngine and UnrealEngine but my computer can't handle them. Thanks
  5. ReyLith

    Beginner in game programming

    Hi, I have about a year and I would like in 3D. Thanks
  6. Hi, I want to develop a game for my final project degree. I have high programming skills (C, C++, Java, Pythom, etc). By this, I had thought to pass directly to use a graphic engine. The problem is that after looking at several pages, I can't find a general graphic engine. My first idea was to start from 0 with OpenGL but other people told me that it is very difficult (what do you think?). I have been looking at some graphic engines as Ogre3D, Torque, XNA and so on. With XNA I can get god result soon but I want to learn how to do in low-level. I'm a little confused and not know where to begin and motor used for this. Thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!