Skip to content

amkraft/Platonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platonic Solids

platonic.h all the geometry

platonic.c OpenGL draw calls

sample

  • point, line, face geometry, dihedral angle, midradius, inradius, side length, volume
  • polyhedra are aligned according to their duals (each face lies along its dual's point)
    • the array indices are aligned, a face index is its dual's point index
    • (this means an object's point data is its dual's face normal data)
  • the triangle solids- at least one vertex lies along +X axis, and if possible another along +Y
  • hexahedron and dodecahedron are face-aligned along +X (since they are aligned to their duals)
  • each polyhedra is centered at origin
  • each polyhedra's circumradius is 1.0 (center to point)
  • clockwise winding
  • only uses gl_triangles (OpenGL ES compatible)

sample

example: scale by consecutive midradii

try it out

  • example app is cross-platform Mac, Linux, Windows
  • type make then make run

input

  • 1 - 5 select between: tetra, octa, hexa, icosa, dodeca
  • SPACE BAR toggle faces/lines/points
  • D superimpose polyhedra's dual

license

MIT

About

platonic solid geometry arranged in the best way

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors