NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: Fu-Kwun Hwang on January 25, 2010, 09:03:56 am



Title: how to control the resolution of a sphere by draging a slider
Post by: Fu-Kwun Hwang on January 25, 2010, 09:03:56 am
Here is a quetsion from one of the user:
Quote
how to control the resolution of a sphere by draging a slider
The resolution property for the sphere can be a String or an Object.
I will simply define a string: resolution, and two variables for slider to set resolution in two different direction. i.e. cs,ps
Then, a function setResolution is defined as the following (which will be called when sliders for cs or ps has been changed).
Code:
public void setResolution () {
  resolution="1,"+cs+","+ps;
}
The following is the result of the code.