Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Verts and indices correct?


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   -  Reputation: 786

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.


Sponsor:



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