Dies ist das Repository meines kleinen Portfolios.
Im Hintergrund läuft eine Planetensimulation, geschrieben in JavaScript und Three.js.
Die zu sehenden Texturen stammen von:
https://www.solarsystemscope.com/textures/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
899 B
59 lines
899 B
import { Material } from './Material.js'; |
|
import { Color } from '../math/Color.js'; |
|
|
|
/** |
|
* parameters = { |
|
* color: <hex>, |
|
* opacity: <float>, |
|
* map: new THREE.Texture( <Image> ), |
|
* alphaMap: new THREE.Texture( <Image> ), |
|
* |
|
* size: <float>, |
|
* sizeAttenuation: <bool> |
|
* |
|
* } |
|
*/ |
|
|
|
class PointsMaterial extends Material { |
|
|
|
constructor( parameters ) { |
|
|
|
super(); |
|
|
|
this.type = 'PointsMaterial'; |
|
|
|
this.color = new Color( 0xffffff ); |
|
|
|
this.map = null; |
|
|
|
this.alphaMap = null; |
|
|
|
this.size = 1; |
|
this.sizeAttenuation = true; |
|
|
|
this.setValues( parameters ); |
|
|
|
} |
|
|
|
copy( source ) { |
|
|
|
super.copy( source ); |
|
|
|
this.color.copy( source.color ); |
|
|
|
this.map = source.map; |
|
|
|
this.alphaMap = source.alphaMap; |
|
|
|
this.size = source.size; |
|
this.sizeAttenuation = source.sizeAttenuation; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
PointsMaterial.prototype.isPointsMaterial = true; |
|
|
|
export { PointsMaterial };
|
|
|