• Stars
    star
    290
  • Rank 138,291 (Top 3 %)
  • Language
    JavaScript
  • Created about 6 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฌ๐ŸŸ โ†ถMesh Deformation / Bending / Following on a Curve

Path Flow aka Mesh Path Deformation Modifier

About

It is called by different names (eg. "Curve Modifier" in Blender, Path-based Deformation, Bend Modifier), but what this does is that it can take a mesh and bends it along a curve or a path.

It's quite a work in progress and renders only in wireframe now.

Feel free to hack the code.

flow-path-3

Examples

Flow - Allow a mesh to follow and bends along a path

Bend - Bend a mesh along another curve

Links

Credits: Killer Whale Orca 3D Model - https://free3d.com/3d-model/killer-whale-89887.html

three.js issue

Technical details

Path positions and Frenet Frames (containing tangents, normals and binormals) are generated using three.js Curve class.

These are stored in a DataTexture in 4 rows.

The vertex shader reads the texture, based on its offset transforms the geometry position.

(More to come)

Features

  • Bend vertex calculations
  • Minimizing twisting effect (Frenet frames)
  • Equi-distance sampling of points (From Curve)
  • Flow - Bend/Rigid option
  • OBJ file loading (via Drag and drop)

TODO

  • Add Sharks Multi-model
  • Granny Knot animation
  • Add OBJ texture support
  • Add follow cursor
  • Make flow a parameter
  • Shading
  • Gif Support
  • Better rotation/transform controls

Context

You can find the full story in this tweet.

Basically I saw that @leon196 had built a curve modifier for Unity3D and I thought there was no reason it cannot be done in js/web/threejs too.

The idea on how to do it was to apply some of the knowledge I already knew.

I first tried "bending" stuff writing TextGeometry in three.js. (That eventually got removed due to complexity but the process build several of the foundation, eg. get tangents, spaced points etc).

Discovering and learning about calculating frenent frames was also important (writing tubes / extrude geometry) mrdoob/three.js#905

The most useful article I read about doing so was from prideout's blog post. http://prideout.net/blog/?p=56

Next steps was the usual - looking into threejs examples and picking up what could be used. In this case, picking off the Spline Editor and Obj Loader examples.

Thanks to @mrdoob and @thespite for enouraging me to try this as usual.

More Repositories

1

space-radar

Disk And Memory Space Visualization App built with Electron & d3.js
JavaScript
1,363
star
2

timeliner

simple javascript timeline library for animation and prototyping
JavaScript
682
star
3

sparks.js

a lightweight 3d particle engine in javascript, compatible with THREE.js and TWEEN.js
JavaScript
431
star
4

kafka-streams-viz

Kafka Streams Topology Sketch Diagram Visualization
JavaScript
394
star
5

FractalLab

WebGL interactive fractal renderer
JavaScript
180
star
6

crayon.js

Node-based Shader Library for Three.js
92
star
7

wild-web-midi

Wild Web Midi - quality Midi playback with JS in your browser (emscripten port of Wild Midi)
C
72
star
8

threejs-term

Terminal Renderer for Three.js
JavaScript
70
star
9

mrdoobapproves

does mrdoob approve?
JavaScript
63
star
10

audiokeys.js

javascript spectrum for HTML5 audio
JavaScript
50
star
11

zz85-bookmarklets

my collections of bookmarklets
JavaScript
33
star
12

contact.js

multi-touch and sensor beaming via websockets
JavaScript
31
star
13

lightbroom

because photos should be swept fast
JavaScript
30
star
14

ThreeLabs

Experiments with Three.js that may or may not make it back into the library.
JavaScript
28
star
15

3ource

browser based git source visualization with three.js
JavaScript
26
star
16

profile-bee

๐Ÿ๐Ÿฆ€๐Ÿ”ฅ An ebpf based CPU profiler written in Rust
JavaScript
21
star
17

nwc-viewer

๐ŸŽผ๐ŸŽน๐ŸŽถโ™ญโ™ฎโ™ฏโ™ฌ open source noteworthy composer music notation viewer & player
JavaScript
19
star
18

ascii-graphs.js

Ascii visualizations
JavaScript
18
star
19

keyboard.js

Virtual Keyboard Experiments
HTML
17
star
20

electron-awesomeness

Electron App to help manage Electron Apps
HTML
17
star
21

fast-rectangles

Different and fast approaches to rendering rectangles in your browser
HTML
16
star
22

phonopaper.js

JS Version of PhonoPaper
JavaScript
16
star
23

DragSpline

A Click and Drag Visual Shape Editor for Game Design
JavaScript
16
star
24

cubic-bezier-approximations

Cubic Bezier Approximations for Robert Penner Easing Equations
JavaScript
16
star
25

chop-chop-video

Video Editing Experiments with JS
JavaScript
15
star
26

js1k-tools

toolkit for js1k
JavaScript
13
star
27

RenderFlies

RenderFlies is a distributed video render system using web browsers and node.js
JavaScript
13
star
28

glsl-cleaner

Parse, Analyse, Clean GLSL code in JS
JavaScript
12
star
29

do.js

Minimalistic Event Dispatcher
JavaScript
7
star
30

bummerman

Remake Bomberman in JS and 3D
JavaScript
7
star
31

packet_radar

Realtime Network Analysis and Visualization
Rust
7
star
32

photocurves

Photo / Color Curves Adjustments
JavaScript
6
star
33

shoeprint

Simple, Useful Poor Man's Network Swiss knife of traceroute, ping, mtr and whois
JavaScript
6
star
34

campjs-livecode

Live Code Editor created on route to CampJS
JavaScript
5
star
35

nwc2ly.py

A Noteworthy Composer importer for Lilypond in Python
Python
4
star
36

drone.js

JS / WebGL / WebVR Drone Simulator
JavaScript
4
star
37

node-ws-slow-client-buffer-leak

Testing Tool to Identify RSS buffer leaks from Slow Clients
JavaScript
3
star
38

node-diarrhoea

fluid, fast, simple library for making ipc calls over uds on node.js
JavaScript
2
star
39

bezierlights

Lights up with Bezier Curves
JavaScript
2
star
40

zz85.github.io

2
star
41

flowlab

2
star
42

airport-maps-experiment

HTML
2
star
43

a-boid-ballet

ballet of boids
JavaScript
2
star
44

midiviz

some simple music visualizations
HTML
2
star
45

quic-initial-degreaser

Clean up greasy Chromium Initial QUIC packets
Rust
2
star
46

about

about things i'm doing?
1
star
47

fluidsynth-emscripten

Attempt to make Fluidsynth run in JS / Browsers with emscripten
C
1
star
48

tcc-trace

a TCP Congestion Control Tracing Tool
Rust
1
star
49

random-sketches

random sketches i make with js
HTML
1
star