From 1f416ea2bdb031e62f397e60259e2e5eec703cc1 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 16 Oct 2020 12:58:49 +0800 Subject: [PATCH] finalize --- README.md | 20 +++++++++++++------- docs/README.md | 18 ++++++++++++------ docs/hello_cube.md | 9 +++++++++ docs/miscellaneous.md | 17 ----------------- {examples => rubbish.bin}/multicamera.py | 9 ++++----- {examples => rubbish.bin}/multilight.py | 0 6 files changed, 38 insertions(+), 35 deletions(-) rename {examples => rubbish.bin}/multicamera.py (78%) rename {examples => rubbish.bin}/multilight.py (100%) diff --git a/README.md b/README.md index 278516c..18c5d45 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,18 @@ See https://taichi.readthedocs.io/en/latest/install.html#troubleshooting for iss If you encounter problems using Taichi THREE, please let me know by [opening an issue at GitHub](https://github.com/taichi-dev/taichi_three/issues/new), many thanks! -## Install from GitHub repo +## Install from latest master branch -You may clone and install from the GitHub repository to get latest changes in Taichi THREE: +If you'd like to keep catching up with latest Taichi THREE updates, please clone it from [our GitHub repository](https://github.com/taichi-dev/taichi_three). Then build and install it: -```py -git clone https://github.com/taichi-dev/taichi_three.git --depth=5 -pip install taichi taichi_glsl -python setup.py build install -``` \ No newline at end of file +```bash +git clone https://github.com/taichi-dev/taichi_three.git +# try this mirror repository on Gitee if the above is too slow: +# git clone https://gitee.com/archibate/taichi_three.git + +cd taichi_three +python3 -m pip install -r requirements.txt # install `taichi` and `taichi-glsl` +python3 -m pip install wheel # required for the next step +python3 setup.py bdist_wheel # create a `.whl` file +pip install -U dist/taichi_three-0.0.6-py3-none-any.whl +``` diff --git a/docs/README.md b/docs/README.md index 278516c..117608c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -43,12 +43,18 @@ See https://taichi.readthedocs.io/en/latest/install.html#troubleshooting for iss If you encounter problems using Taichi THREE, please let me know by [opening an issue at GitHub](https://github.com/taichi-dev/taichi_three/issues/new), many thanks! -## Install from GitHub repo +## Install from latest master branch -You may clone and install from the GitHub repository to get latest changes in Taichi THREE: +If you'd like to keep catching up with latest Taichi THREE updates, please clone it from [our GitHub repository](https://github.com/taichi-dev/taichi_three). Then build and install it: -```py -git clone https://github.com/taichi-dev/taichi_three.git --depth=5 -pip install taichi taichi_glsl -python setup.py build install +```bash +git clone https://github.com/taichi-dev/taichi_three.git +# try this mirror repository on Gitee if the above is too slow: +# git clone https://gitee.com/archibate/taichi_three.git + +cd taichi_three +python3 -m pip install -r requirements.txt # install `taichi` and `taichi-glsl` +python3 -m pip install wheel # required for the next step +python3 setup.py bdist_wheel # create a `.whl` file +pip install -U dist/taichi_three-0.0.6-py3-none-any.whl ``` \ No newline at end of file diff --git a/docs/hello_cube.md b/docs/hello_cube.md index c033a5f..2916e50 100644 --- a/docs/hello_cube.md +++ b/docs/hello_cube.md @@ -3,6 +3,15 @@ The goal of this section is to give a brief introduction to Taichi THREE. We will start by setting up a scene, with a simple cube, as THREE.js tutorial starts from too. A working example is provided at the bottom of the page in case you get stuck and need help. + +## Before we get started + +First of all, make sure you have installed `taichi_three` (see [README.md](/README.md)), then import the it as a package: + +```py +import taichi_three as t3 +``` + ## Creating the scene To actually be able to display anything with Taichi THREE, we need three things: scene, camera, and model, so that we can render the scene with camera. diff --git a/docs/miscellaneous.md b/docs/miscellaneous.md index 4707e63..83f6db2 100644 --- a/docs/miscellaneous.md +++ b/docs/miscellaneous.md @@ -4,23 +4,6 @@ Here's a collection of some random yet useful stuffs you might need. -## Install from latest master branch - -If you'd like to keep catching up with latest Taichi THREE updates, please clone it from [our GitHub repository](https://github.com/taichi-dev/taichi_three). Then build and install it: - -```bash -git clone https://github.com/taichi-dev/taichi_three.git -# try this mirror repository on Gitee if the above is too slow: -# git clone https://gitee.com/archibate/taichi_three.git - -cd taichi_three -python3 -m pip install -r requirements.txt # install `taichi` and `taichi-glsl` -python3 -m pip install wheel # required for the next step -python3 setup.py bdist_wheel # create a `.whl` file -pip install -U dist/taichi_three-0.0.6-py3-none-any.whl -``` - - ## Introducing Taichi [Taichi](https://github.com/taichi-dev/taichi) is a programming langurage that is highly-embed into Python that basically allows you to write high-performance GPU programs in Python syntax. diff --git a/examples/multicamera.py b/rubbish.bin/multicamera.py similarity index 78% rename from examples/multicamera.py rename to rubbish.bin/multicamera.py index 342a520..408d5f4 100644 --- a/examples/multicamera.py +++ b/rubbish.bin/multicamera.py @@ -7,10 +7,12 @@ scene = t3.Scene() model = t3.Model(t3.Mesh.from_obj(t3.readobj('assets/monkey.obj', scale=0.8))) scene.add_model(model) -camera = t3.Camera(res=(256, 256), pos=[0, 0, 2.5], target=[0, 0, 0], up=[0, 1, 0]) +camera = t3.Camera(res=(256, 256)) +camera.ctl = t3.CameraCtl(pos=[0, 0, 2.5], target=[0, 0, 0], up=[0, 1, 0]) scene.add_camera(camera) -camera2 = t3.Camera(pos=[0, 1, -2], target=[0, 1, 0], up=[0, 1, 0]) +camera2 = t3.Camera() +camera2.ctl = t3.CameraCtl(pos=[0, 1, -2], target=[0, 1, 0], up=[0, 1, 0]) scene.add_camera(camera2) light = t3.Light([0.4, -1.5, -0.8]) @@ -19,9 +21,6 @@ camera.type = camera.ORTHO camera2.set_intrinsic(256, 256, 256, 256) -print(camera2.export_intrinsic()) -print(camera2.export_extrinsic()) - gui = ti.GUI('Model', camera.res) gui2 = ti.GUI('Model2', camera2.res) diff --git a/examples/multilight.py b/rubbish.bin/multilight.py similarity index 100% rename from examples/multilight.py rename to rubbish.bin/multilight.py