npm install --save three
<template>
<div id="indexLizi" />
</template>
<script>
import * as THREE from "three";
export default {
name: "Pointwave",
props: {
amountX: {
type: Number,
default: 50,
},
amountY: {
type: Number,
default: 50,
},
color: {
type: Number,
default: 0x497fb7,
},
top: {
type: Number,
default: 150,
},
},
data() {
return {
count: 0,
mouseX: 0,
windowHalfX: null,
camera: null,
scene: null,
particles: null,
renderer: null,
};
},
mounted() {
this.init();
this.animate();
this.onWindowResize();
},
methods: {
init: function () {
const SEPARATION = 100;
const SCREEN_WIDTH = window.innerWidth;
const SCREEN_HEIGHT = window.innerHeight;
const container = document.createElement("div");
this.windowHalfX = window.innerWidth / 2;
container.