immediate.py 1.61 KB
Newer Older
1 2 3 4
"""
Immediate drawing without explicitely creating a context.
"""

5
from .context import Context
Dario Seyb's avatar
Dario Seyb committed
6

7
def display_faces(vertices, face_indices, normals=None, colors=None, uvs=None,
8
                  shading='flat', z_offset=0.5, texture=None, width=600, height=400,
9 10
                  background_color = '#dddddd', clipping_planes = []):
    Context(width, height, background_color).draw_faces(vertices, face_indices, normals, colors, uvs, shading, z_offset, texture, clipping_planes).display()
Dario Seyb's avatar
Dario Seyb committed
11

12
def display_edges(vertices, edge_indices=None, colors=None, uvs=None,
13 14 15
                  z_offset=0, texture=None, line_width=1, width=600, height=400,
                  background_color = '#dddddd', clipping_planes = []):
    Context(width, height, background_color).draw_edges(vertices, edge_indices, colors, uvs, z_offset, texture, line_width, clipping_planes).display()
Dario Seyb's avatar
Dario Seyb committed
16

17
def display_vertices(vertices, colors=None, uvs=None, point_size=1, z_offset=0, texture=None,
18
                     perspective=False, width=600, height=400,
19 20
                     background_color = '#dddddd', clipping_planes = []):
    Context(width, height, background_color).draw_vertices(vertices, colors, uvs, point_size, z_offset, texture, perspective, clipping_planes).display()
21 22 23

def display(obj, shading='flat', point_size=1, z_offset=0, texture=None,
            perspective=False, width=600, height=400,
24 25
            background_color = '#dddddd', clipping_planes = []):
    Context(width, height, background_color).draw(obj, shading= shading, point_size = point_size, z_offset= z_offset, texture = texture, perspective = perspective, clipping_planes = clipping_planes).display()