[+] Helper to create a circle
This commit is contained in:
@@ -31,3 +31,18 @@ export function box(width: number, height: number, depth: number): THREE.BufferG
|
|||||||
geometry.setAttribute('position', new THREE.Float32BufferAttribute(position, 3))
|
geometry.setAttribute('position', new THREE.Float32BufferAttribute(position, 3))
|
||||||
return geometry
|
return geometry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a 2D circle
|
||||||
|
* @param color
|
||||||
|
* @param z
|
||||||
|
* @param r
|
||||||
|
*/
|
||||||
|
export function circle(color: number, z: number, r: number): THREE.Mesh
|
||||||
|
{
|
||||||
|
const geometry = new THREE.CircleGeometry(r, 32)
|
||||||
|
const material = new THREE.MeshBasicMaterial({color})
|
||||||
|
const circle = new THREE.Mesh(geometry, material)
|
||||||
|
circle.position.z = z
|
||||||
|
return circle
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import * as THREE from 'three'
|
import * as THREE from 'three'
|
||||||
import * as helper from "@/animation/Helpers";
|
import * as helper from "@/animation/Helpers";
|
||||||
|
import {initMouseTracker, moused} from "@/animation/MouseTracker";
|
||||||
|
import {circle} from "@/animation/Helpers";
|
||||||
|
|
||||||
let renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera
|
let renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera
|
||||||
const objects = []
|
const objects = []
|
||||||
|
|||||||
Reference in New Issue
Block a user