• Create Account

I cant get my floor model to work properly

Old topic!
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.

3 replies to this topic

#1andreidim  Members   -  Reputation: 275

Like
0Likes
Like

Posted 09 September 2012 - 09:17 AM

Hello guys, im making a new 3D game, i made a floor model, but it dowsnt draw the fourth triangle.
Here is the source: http://EvoGame.codeplex.com

Here is the model:

vertecies.Add(new VertexPositionNormalTexture(new Vector3(-0.5f, -0.5f, 0.5f), Vector3.Up, new Vector2(0, 1)));
vertecies.Add(new VertexPositionNormalTexture(new Vector3(-0.5f, -0.5f, -0.5f), Vector3.Up, new Vector2(0, 0)));
vertecies.Add(new VertexPositionNormalTexture(new Vector3(0.5f, -0.5f, 0.5f), Vector3.Up, new Vector2(1, 0)));
vertecies.Add(new VertexPositionNormalTexture(new Vector3(0.5f, -0.5f, -0.5f), Vector3.Up, new Vector2(1, 0)));
vertecies.Add(new VertexPositionNormalTexture(new Vector3(0.5f, -0.5f, 0.5f), Vector3.Up, new Vector2(1, 1)));
vertecies.Add(new VertexPositionNormalTexture(new Vector3(-0.5f, -0.5f, 0.5f), Vector3.Up, new Vector2(0, 1)));

Thanks,
Andrei

Like
0Likes
Like

Posted 09 September 2012 - 11:28 AM

Ok since you are declaring your vertices manual I suppose you do the same with the indices. I don't know why you need six vertices to make a floor or which vertices are used for the fourth triangle but my first guess is that its happening because of the cullmode. Write:
GraphicsDevice.RasterizerState = RasterizerState.CullNone;
If the triangle shows up you have to declare it with the negated draworder.

#3andreidim  Members   -  Reputation: 275

Like
0Likes
Like

Posted 09 September 2012 - 11:49 AM

found the problem, added 3 more vertecies.

and thanks, it didnt work:( im sorry

Edited by andreidim, 09 September 2012 - 11:49 AM.

#4BCullis  Crossbones+   -  Reputation: 1943

Like
2Likes
Like

Posted 13 September 2012 - 02:57 PM

If I sit down and plot out the points you indicate in world space, I get two overlapping triangles with a missing chunk. And I can see why your third triangle "fixed" it.

If you don't want to use indexed drawing (which would let you use just 4 vertices) then you just need to change the position vector of your last (6th) vertex in the initial list to
(-0.5, -0.5, -0.5) and texture coords to (0,0) (so that it'll show up next to vertex "2").

Edited by BCullis, 13 September 2012 - 02:57 PM.

Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

Old topic!
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.

PARTNERS