bitluni / ESP32VGA

http://bitluni.net/esp32-vga
128 stars 24 forks source link

mesh drawEdges instead of triangles error? #15

Open gritd opened 1 year ago

gritd commented 1 year ago

So I've been trying to get just wire renders from the engine3D in vga3Bit for a while now. DrawTriangles example work well, but when I try to use anything with drawEdges or vertices in the mesh.h it just does not show? Am I overlooking something?

1 - export edges and vertices with the stlconverter (works, I see a list of these)

  1. replace model.drawTriangles(engine, vga... with: model.drawEdges(vga,vga.RGB...

draws no edges.. (also tried with removing the z-sorting because it's not needed but still nothing) I rewrote the drawtriangles to draw a triangle outline instead of the filled one but I just want the vertices/edges instead and not a surface filled with triangles

here's a stlconverter sample output with a small 3D pyramid model test which I just can't to render as wireframe:

namespace pyramid { const int vertexCount = 10; const int edgeCount = 24; const float vertices[][3] = { -0.2500, -0.0000, -0.3153, 0.0000, 0.1443, 0.0000, 0.0000, 0.4330, -0.3153, -0.2500, -0.2887, 0.0000, 0.0000, -0.1443, 0.3153, -0.5000, -0.4330, -0.3153, 0.0000, -0.4330, -0.3153, 0.2500, -0.2887, 0.0000, 0.5000, -0.4330, -0.3153, 0.2500, -0.0000, -0.3153, }; const unsigned short edges[][2] = { 0, 1, 1, 2, 0, 2, 3, 4, 1, 4, 1, 3, 0, 3, 0, 5, 3, 5, 5, 6, 3, 6, 3, 7, 6, 7, 4, 7, 6, 8, 7, 8, 8, 9, 7, 9, 1, 7, 1, 9, 2, 9, 6, 9, 0, 6, 0, 9, }; };