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

change radius of THREE.SphereGeometry with slider #41

Open
GoogleCodeExporter opened this issue Oct 30, 2015 · 2 comments
Open

change radius of THREE.SphereGeometry with slider #41

GoogleCodeExporter opened this issue Oct 30, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

http://mrtn.ch/3D/13_06_27_gui_03.html

What steps will reproduce the problem?
1. move Radius slider, nothing happens

What is the expected output? What do you see instead?

Want to use dat-gui sliders to change the radius of the sphere and later also 
other properties such as segments or thetaLength...

Sphere is generated based on variables but I don't know how to update these 
variables?


What version of the product are you using? On what operating system?

http://stemkoski.github.io/Three.js/js/DAT.GUI.min.js / mac os x 10.6.8 / 
safari, chrome

Please provide any additional information below.

Can't figure out how to do it, thanks for your help.

Original issue reported on code.google.com by [email protected] on 27 Jun 2013 at 11:37

@GoogleCodeExporter
Copy link
Author

This is more of a threejs issue. The parameters on the sphere geometry do not 
update the geometry when changed. You probably want to replace "radius = value" 
in your onChange fnuction to:
sphere.geometry = new THREE.SphereGeometry (value, segmentsWidth, 
segmentsHeight, phiStart, phiLength, thetaStart, thetaLength );
sphere.geometry.verticesNeedUpdate = true;

Original comment by [email protected] on 1 May 2014 at 1:37

@GoogleCodeExporter
Copy link
Author

Won't it be cheaper to scale the mesh rather than create a new geometry?

Original comment by [email protected] on 24 Oct 2014 at 1:24

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

No branches or pull requests

1 participant