This repository has been archived on 2022-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
GeometryDash3D/js/Plane.js
2022-11-22 10:40:56 +01:00

29 lines
788 B
JavaScript

import { Element } from "./Element.js";
import { textureGradient } from "./utils.js";
export class Plane extends Element {
constructor(width, height, color1, color2) {
super();
console.log(width, height);
const Tcolor1 = new THREE.Color(color1);
const Tcolor2 = new THREE.Color(color2);
this.data = new THREE.Mesh(
new THREE.PlaneGeometry(width, height),
new THREE.MeshBasicMaterial({
color: color1,
side: THREE.DoubleSide,
map: textureGradient(
width,
height,
Tcolor1.getStyle(),
Tcolor2.getStyle()
),
})
);
this.data.rotation.x = 2;
}
}