Skip to content

Generate plane geometry data effortlessly for your WebGL applications using the `geometry-plane` utility. This library provides an easy way to create plane meshes with customizable segments, dimensions, and UV mapping. Build dynamic visuals with precise control over plane geometry, enabling you to focus on creating stunning 3D experiences.

Notifications You must be signed in to change notification settings

ahmerhh/geometry-plane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ahmerhh/geometry-plane

Plane geometry, extracted from three.js

Installation

$ npm install --save @ahmerhh/geometry-plane

Usage

import getPlaneGeometry from '@ahmerhh/geometry-plane';

const { verts, uvs, faces } = getPlaneGeometry(1, 1, 2, 2);

// create buffers

API

geo = getPlaneGeometry(w, h, dx, dy)

Returns a new geometry with:

  • verts is an float32 array of coordinates (by group of 3).
  • uvs is an float32 array of uvs (by group of 2).
  • faces is an uint16/32 array of the faces.

and where:

  • w is the width of the plane (default is 1).
  • h is the height of the plane (default is 1).
  • dx is the number of divisions on the width (default is 1).
  • dy is the number of divisions on the height (default is 1).

License

MIT, see LICENSE.md for more details.

Credits

Thanks to three.js for the code.

About

Generate plane geometry data effortlessly for your WebGL applications using the `geometry-plane` utility. This library provides an easy way to create plane meshes with customizable segments, dimensions, and UV mapping. Build dynamic visuals with precise control over plane geometry, enabling you to focus on creating stunning 3D experiences.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published