An open source program to render meshes in 3D, written using pygame.
w
- move forward along the x-axis
x
- move backward along the x-axis
a
- move forward along the y-axis
d
- move backward along the y-axis
z
- move forward along the z-axis
e
- move backward along the z-axis
t
- move ward in the current direction
b
- move ward in the current direction
j
- increase the polar angle (theta)
l
- decrease the polar angle (theta)
i
- increase the azimuthal angle (phi)
k
- decrease the azimuthal angle (phi)
- Ensure that python version 3 is installed.
- Ensure that pygame is installed.
- Download all the .py files in the src folder.
- Run
main.py
Different meshes can be created using the API provided in write.py
. An example of a toroidal mesh
is given in scratch.py
.
A mesh is a list of structures, where a structure is one of the three following objects:
- Line, defined by a list of two points. A line can be generated using the
add_line(point1, point2)
function inwrite.py
. - Curve, defined by a list of two or more points. A curve can be generated using the
add_curve(points)
function inwrite.py
, wherepoints
is a list of points. - Surface, defined by a list of two or more lists of two or more points. A surface can be generated using the
add_surface(points)
function inwrite.py
, wherepoints
is a list of lists of points.
Once all the structures have been defined, the write()
function can be called to write the mesh into mesh.json
, from where the mesh is loaded everytime main.py
is run.