Skip to content

ArrowHelper not working #258

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

Closed
Boomer91 opened this issue Apr 17, 2019 · 2 comments · Fixed by #259
Closed

ArrowHelper not working #258

Boomer91 opened this issue Apr 17, 2019 · 2 comments · Fixed by #259

Comments

@Boomer91
Copy link

Hi,

I'm trying to render an arrow butnothing is rendered. Notebook example attached.

`from pythreejs import *

scene = Scene()

camera = PerspectiveCamera(position=[15, 0, -2], up=[0,0,-1])
scene.add(camera)

control = OrbitControls(controlling=camera, maxDistance=100)

renderer = Renderer(camera=camera, scene=scene,
controls=[control],
width=1000, height=800
)

axes = AxesHelper(size=1)
scene.add(axes)

scene.add(ArrowHelper())

scene.add(AmbientLight(intensity=0.3))

renderer`

@vidartf
Copy link
Member

vidartf commented Apr 18, 2019

Hi, and thanks for the report. I can reproduce with your code (thanks!).

It turns out, ArrowHelper had quite a bit of custom mapping needed. I'll open a PR to fix it, and reference this issue there.

@Boomer91
Copy link
Author

Boomer91 commented May 8, 2020

Hi, thanks for developing this awesome tool!

Arrows do render now, but there seems to be a bug with the direction argument. See minimal example below. Unit directions work fine, but e.g. dir = (1,1,1) renders a dir = (1,0,0) vector.

Thanks,
Cyriel

from pythreejs import *

scene = Scene()

camera = PerspectiveCamera(position=[15, 0, -2], up=[0,0,-1])
scene.add(camera)

control = OrbitControls(controlling=camera, maxDistance=100)

renderer = Renderer(camera=camera, scene=scene,
controls=[control],
width=1000, height=800
)

axes = AxesHelper(size=1)
scene.add(axes)

arrow = ArrowHelper(
        dir=[1,0,0],
        origin=[1,0,0],
        length=3,
        color='red',
        headLength=None,
        headWidth=None,
)
scene.add(arrow)

arrow = ArrowHelper(
        dir=[0,1,0],
        origin=[1,0,0],
        length=3,
        color='green',
        headLength=None,
        headWidth=None,
)
scene.add(arrow)

arrow = ArrowHelper(
        dir=[0,0,1],
        origin=[1,0,0],
        length=3,
        color='blue',
        headLength=None,
        headWidth=None,
)
scene.add(arrow)

arrow = ArrowHelper(
        dir=[1,1,1],
        origin=[1,0,0],
        length=3,
        color='black',
        headLength=None,
        headWidth=None,
)
scene.add(arrow)

scene.add(AmbientLight(intensity=0.3))

renderer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants