Sidebar.Geometry.IcosahedronGeometry.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) {
  5. var strings = editor.strings;
  6. var container = new UI.Row();
  7. var geometry = object.geometry;
  8. var parameters = geometry.parameters;
  9. // radius
  10. var radiusRow = new UI.Row();
  11. var radius = new UI.Number( parameters.radius ).onChange( update );
  12. radiusRow.add( new UI.Text( strings.getKey( 'sidebar/geometry/icosahedron_geometry/radius' ) ).setWidth( '90px' ) );
  13. radiusRow.add( radius );
  14. container.add( radiusRow );
  15. // detail
  16. var detailRow = new UI.Row();
  17. var detail = new UI.Integer( parameters.detail ).setRange( 0, Infinity ).onChange( update );
  18. detailRow.add( new UI.Text( strings.getKey( 'sidebar/geometry/icosahedron_geometry/detail' ) ).setWidth( '90px' ) );
  19. detailRow.add( detail );
  20. container.add( detailRow );
  21. //
  22. function update() {
  23. editor.execute( new SetGeometryCommand( editor, object, new THREE[ geometry.type ](
  24. radius.getValue(),
  25. detail.getValue()
  26. ) ) );
  27. }
  28. return container;
  29. };
  30. Sidebar.Geometry.IcosahedronBufferGeometry = Sidebar.Geometry.IcosahedronGeometry;