I would like to render a polygon in 3D Space

Hello,

First, my apologies I do not speak Chinese, I hope that I chose an acceptable category for this question. I would like to render a set of polygons in 3D with Taichi.


@ti.dataclass
class Polygon:
    """
    - The polygon dataclass contains 4 vertices.
    - Each vertex represents a 3D point
    - Vertices are ordered clockwise
        - top left, top right, bottom right, bottom left
    """
    vertices = ti.Vector.field(
        n=4,
        dtype=ti.f32,
        shape=(4,)
    )

I was wondering, are there any minimal examples that may help me set up a camera and convert from geometric space to pixel space so that I can render?

Thank you

Would I need to create triangles from my polygons in order to properly render?

Hi @kurt-rhee , welcome to Taichi community.
There is a built-in GUI in Taichi which can help render mesh for preview purpose. Please check the document below.

There is also some sample code for rendering a simple scene though with triangles (cloth dropping on to some spheres) here.

Thank you! This is very helpful

1 个赞

Hi kurt, you can also join our discord channel: Taichi Community