Sidebar.Geometry.IcosahedronGeometry.js 881 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Sidebar.Geometry.IcosahedronGeometry = function ( signals, geometry ) {
  2. var container = new UI.Panel();
  3. container.setBorderTop( '1px solid #ccc' );
  4. container.setPaddingTop( '10px' );
  5. // radius
  6. var radiusRow = new UI.Panel();
  7. var radius = new UI.Number( geometry.radius ).onChange( update );
  8. radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ).setColor( '#666' ) );
  9. radiusRow.add( radius );
  10. container.add( radiusRow );
  11. // detail
  12. var detailRow = new UI.Panel();
  13. var detail = new UI.Integer( geometry.detail ).setRange( 0, Infinity ).onChange( update );
  14. detailRow.add( new UI.Text( 'Detail' ).setWidth( '90px' ).setColor( '#666' ) );
  15. detailRow.add( detail );
  16. container.add( detailRow );
  17. //
  18. function update() {
  19. editor.remakeGeometry( geometry,
  20. {
  21. radius: radius.getValue(),
  22. detail: detail.getValue()
  23. }
  24. );
  25. }
  26. return container;
  27. }