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

Integration with Trackball Control in WebGL renderer? #32

Open
ghost opened this issue Oct 14, 2013 · 2 comments
Open

Integration with Trackball Control in WebGL renderer? #32

ghost opened this issue Oct 14, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2013

Hi, thanks for this fantastic project.

I am looking into the feature where I can control the camera with mouse, such as this:
http://www.guoshihui.net/webglcontrol/control.html

I tried by several ways, the closest attempt is to edit the WebglBase.coffee file like the following:
http://jsfiddle.net/SyYDQ/

But there is one important line missing, that's
@controls.addEventListener "change", render

If I add this, it will say "render" is not defined, but I am a bit loss which render function to call. Can you give me some hints on this issue? Many thanks!

@idflood
Copy link
Owner

idflood commented Oct 14, 2013

Hi,

I'm not sure about it but it looks like in the example it's calling the render function at the end of the html (line 206). Since in threenodes the renderer.render is already called on each frames, you only have to call the control.update function. So it would be something like this:

@controls.addEventListener "change", () =>
  @controls.update()

Hope it helps.

@ghost
Copy link
Author

ghost commented Nov 5, 2013

Hi,

I tried by multiple ways but still didn't figure this out. Will leave it here and come back later after I got more familiar with Threenodes.

Another quick question would be how can I change the range of the slider bar for some parameters, such as position parameter for geometry is initialized as [-0.5 0.5], how can I change this default value?

Cheers!

Shihui

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

No branches or pull requests

1 participant