Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


scap3y

Member Since 29 Oct 2012
Offline Last Active Nov 15 2012 03:45 AM

Topics I've Started

STL Mesh Rendering

30 October 2012 - 02:58 AM

Hey All,

I want to render a mesh which is stored in the .STL format (a small part of the file is given below) and control it via interactions from the mouse.

solid 20110519125647
facet normal -0.334931 -0.236570 -0.912061
outer loop
vertex 10.481026 1.232170 4.632938
vertex 10.542211 1.232170 4.610470
vertex 10.542211 1.145546 4.632938
endloop
endfacet

facet normal -0.174629 -0.346906 -0.921499
outer loop
vertex 10.669180 1.030518 4.632938
vertex 10.743861 1.030518 4.618786
vertex 10.743861 0.992924 4.632938
endloop
endfacet

facet normal -0.117726 -0.352012 -0.928562
outer loop
vertex 10.844687 0.959465 4.632938
vertex 10.743861 1.030518 4.618786
vertex 10.844687 1.030518 4.606003
endloop
endfacet


Now, this continues to about 80,000 to 140,000 faces, depending on the file. I have written a basic program to read these meshes using fopen but it is very inefficient (takes more than 10 min for the smallest files). I have also implemented a custom ArcBall which works on any geometry after it has been rendered.

It would be really nice if someone can give me a better way to handle these files.

PARTNERS