Skip to content

Instantly share code, notes, and snippets.

View dImrich's full-sized avatar
☯️

dImrich dImrich

☯️
View GitHub Profile
@dImrich
dImrich / curved3Plane.js
Created January 6, 2017 18:00
Bend Three JS Plane Geometry With Bezier Curve
//Bend Three JS plane geometry with bezier curve
//Curved plane generation, bezier curve plane,
function bendPlaneGeometry(planeGeometry, centerBendZ)
{
var curve = new THREE.CubicBezierCurve3(
planeGeometry.vertices[0],
new THREE.Vector3(planeGeometry.parameters.width/2, 0, centerBendZ ),
new THREE.Vector3(planeGeometry.parameters.width/2, 0, centerBendZ ),
planeGeometry.vertices[(planeGeometry.vertices.length/2) - 1]
);