Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/threejs_4_deno/src/Three.js>BufferGeometry

A simple transformation of three.js for use within a Deno workflow
Go to Latest
class BufferGeometry
Re-export
import { BufferGeometry } from "https://deno.land/x/threejs_4_deno@v121/src/Three.js";

This is a superefficent class for geometries because it saves all data in buffers. It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the necessary buffer calculations. It is mainly interesting when working with static objects.

Constructors

new
BufferGeometry()

This creates a new BufferGeometry. It also sets several properties to an default value.

Properties

attributes: { [name: string]: BufferAttribute | InterleavedBufferAttribute; }
boundingBox: Box3 | null
boundingSphere: Sphere | null
deprecated
drawcalls: any
drawRange: { start: number; count: number; }
groups: { start: number; count: number; materialIndex?: number; }[]
id: number

Unique number of this buffergeometry instance

index: BufferAttribute | null
readonly
isBufferGeometry: true
morphAttributes: { [name: string]: (BufferAttribute | InterleavedBufferAttribute)[]; }
morphTargetsRelative: boolean
name: string
deprecated
offsets: any
type: string
userData: { [key: string]: any; }
uuid: string

Methods

addAttribute(
name: any,
array: any,
itemSize: any,
): any
deprecated
addDrawCall(
start: any,
count: any,
indexOffset?: any,
): void
addGroup(
start: number,
count: number,
materialIndex?: number,
): void
deprecated
addIndex(index: any): void

Bakes matrix transform directly into vertex coordinates.

deprecated
clearDrawCalls(): void
clearGroups(): void
clone(): this

Computes bounding box of the geometry, updating Geometry.boundingBox attribute. Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.

Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. Bounding spheres aren't' computed by default. They need to be explicitly computed, otherwise they are null.

Computes vertex normals by averaging face normals.

copy(source: BufferGeometry): this
dispose(): void

Disposes the object from memory. You need to call this when you want the bufferGeometry removed while the application is running.

fromGeometry(geometry: Geometry, settings?: any): BufferGeometry
lookAt(v: Vector3): void
merge(geometry: BufferGeometry, offset?: number): BufferGeometry
deprecated
removeAttribute(name: string): BufferGeometry
rotateX(angle: number): BufferGeometry
rotateY(angle: number): BufferGeometry
rotateZ(angle: number): BufferGeometry
scale(
x: number,
y: number,
z: number,
): BufferGeometry
setDrawRange(start: number, count: number): void
setIndex(index: BufferAttribute | number[] | null): BufferGeometry
toJSON(): any
translate(
x: number,
y: number,
z: number,
): BufferGeometry
updateFromObject(object: Object3D): void

Static Properties

MaxIndex: number