taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.05k stars 2.26k forks source link

Doc error in Camera.projection_mode() #8516

Open SPOREIII opened 2 months ago

SPOREIII commented 2 months ago

doc link The documentation states that to change the projection mode you should pass 0 or 1.

Camera projection mode, 0 for perspective and 1 for orthogonal.

But passing in an integer parameter will result in an error:

TypeError: projection_mode(): incompatible function arguments. The following argument types are supported:
    1. (self: taichi._lib.core.taichi_python.PyCamera, arg0: taichi::ui::ProjectionMode) -> None

Invoked with: <taichi._lib.core.taichi_python.PyCamera object at 0x0000022D54A6E8B0>, 1

I found that the correct way to do it is to pass in 'ti.ui.ProjectionMode.Orthogonal' or 'ti.ui.ProjectionMode.Perspective'