Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

particle size does not change in GGUI window when move camera #6299

Open
ZeyingXuHuaWei opened this issue Oct 12, 2022 · 3 comments
Open

particle size does not change in GGUI window when move camera #6299

ZeyingXuHuaWei opened this issue Oct 12, 2022 · 3 comments
Assignees
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@ZeyingXuHuaWei
Copy link

Describe the bug
particle size in GGUI does not change when camera moves near to the particle.

To Reproduce

# sample code here
"""
after run this demo please press key w to move camera towards the sphere, and then you see that the ball does not change its size.
"""

import taichi as ti

ti.init(arch=ti.cpu)

balls = ti.Vector.field(3,ti.f32,(1))
balls[0] = ti.math.vec3(0.0)

# visualize in ggui
window = ti.ui.Window("visual a ball", (600, 600), vsync=True)
canvas = window.get_canvas()
scene = ti.ui.Scene()
camera = ti.ui.Camera()

cam_dis=10.0
angle = 0.0
cam_height = 4.0
camera.position(cam_dis, cam_height, cam_dis)
camera.lookat(0.0, 0.5, 0.0)

while window.running:

    camera.track_user_inputs(window, movement_speed=0.05, hold_key=ti.ui.RMB)
    scene.set_camera(camera)

    scene.point_light(pos=(0, 3, 3), color=(1, 1, 1))
    scene.particles(balls, radius=1.0, color=(1.0,0.0,0.0))
    canvas.scene(scene)
    window.show()
$ python my_sample_code.py
[Taichi] version 1.1.3, llvm 10.0.0, commit 1262a70a, win, python 3.10.0
[Taichi] Starting on arch=x64
...
@ZeyingXuHuaWei ZeyingXuHuaWei added the potential bug Something that looks like a bug but not yet confirmed label Oct 12, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Oct 12, 2022
@FantasyVR
Copy link
Collaborator

Hi @ZeyingXuHuaWei , the particle is rendered using Point Primitive which has size limits in Vulkan.

@ZeyingXuHuaWei
Copy link
Author

hi, @FantasyVR , so how to render a sphere with arbitrary size?

@PENGUINLIONG
Copy link
Member

I would recommend you to build a spheric mesh and manage the scaling yourself. There are many resources about it like https://www.danielsieger.com/blog/2021/03/27/generating-spheres.html. Use scene.mesh to draw it

@PENGUINLIONG PENGUINLIONG moved this from Untriaged to Backlog in Taichi Lang Oct 14, 2022
@PENGUINLIONG PENGUINLIONG self-assigned this Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
Status: Backlog
Development

No branches or pull requests

3 participants