Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Verts and indices correct?

4: Adsense

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.


  • You cannot reply to this topic
No replies to this topic

#1 GameGeezer   Members   

1090
Like
0Likes
Like

Posted 08 October 2012 - 10:30 AM

I'm writing a marching cubes extractor for my game and I'm running into an error where there are vertices and indiec, but no polygons are being drawn.
Could anyone take a quick look at how i'm adding my vertices and indices? This is using JME3.

here is where I create my triangles

[source lang="java"] /* Create the triangle */ ArrayList<Triangle> t = new ArrayList<Triangle>(); for (i = 0; MCData.triTable[cubeindex][i] != -1; i += 3) { Triangle tri = new Triangle(vertlist[MCData.triTable[cubeindex][i]], vertlist[MCData.triTable[cubeindex][i+1]], vertlist[MCData.triTable[cubeindex][i+2]]); t.add(tri); }[/source]

Here is where I add my trianges to the mesh
[source lang="java"] //Node n = new Node("Node " + loc[0] + i + "," + loc[1] + j + "," + loc[2] + k); for (int triCt = 0; triCt < output.size(); triCt++) { mesh.getIndices().add(MCData.indexes[0] + mesh.getVertices().size()); mesh.getIndices().add(MCData.indexes[1] + mesh.getVertices().size()); mesh.getIndices().add(MCData.indexes[2] + mesh.getVertices().size()); mesh.getVertices().add(output.get(triCt).get1()); mesh.getVertices().add(output.get(triCt).get2()); mesh.getVertices().add(output.get(triCt).get3()); mesh.addNormals(MCData.normals); mesh.addTexCoords(MCData.texCoords); }[/source]
Do the VErts and indices appear to be added correctly? thanks.

Edited by GameGeazer, 08 October 2012 - 10:43 AM.





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.