MeshBasicMaterial.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * @author mr.doob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * map: new THREE.UVMap( <Image> ),
  8. * opacity: <float>,
  9. * blending: THREE.NormalBlending,
  10. * wireframe: <boolean>,
  11. * wireframe_linewidth: <float>
  12. * }
  13. */
  14. THREE.MeshBasicMaterial = function ( parameters ) {
  15. this.id = THREE.MeshBasicMaterialCounter.value ++;
  16. this.color = new THREE.Color( 0xff0000 );
  17. this.map = null;
  18. this.opacity = 1;
  19. this.blending = THREE.NormalBlending;
  20. this.wireframe = false;
  21. this.wireframe_linewidth = 1;
  22. if ( parameters ) {
  23. if ( parameters.color !== undefined ) this.color.setHex( parameters.color );
  24. if ( parameters.map !== undefined ) this.map = parameters.map;
  25. if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity;
  26. if ( parameters.blending !== undefined ) this.blending = parameters.blending;
  27. if ( parameters.wireframe !== undefined ) this.wireframe = parameters.wireframe;
  28. if ( parameters.wireframe_linewidth !== undefined ) this.wireframe_linewidth = parameters.wireframe_linewidth;
  29. }
  30. this.toString = function () {
  31. return 'THREE.MeshBasicMaterial (<br/>' +
  32. 'id: ' + this.id + '<br/>' +
  33. 'color: ' + this.color + '<br/>' +
  34. 'map: ' + this.map + '<br/>' +
  35. 'opacity: ' + this.opacity + '<br/>' +
  36. 'blending: ' + this.blending + '<br/>' +
  37. 'wireframe: ' + this.wireframe + '<br/>' +
  38. 'wireframe_linewidth: ' + this.wireframe_linewidth +'<br/>' +
  39. ')';
  40. };
  41. }
  42. THREE.MeshBasicMaterialCounter = { value: 0 };
粤ICP备19079148号