Comments (5)
Sorry I don't maintain sculptgl anymore!
from sculptgl.
@stephomi ok thank you , if you don't want to work anymore with the project , so kindly can you give me hints how to add that option ?
from sculptgl.
I don't mind answering specific question but this one is too general/complex.
User input (interaction), rendering (the lasso), etc...
However, I can answer for the polygon/lasso thing:
- you need to triangulate the polygon, for example with https://github.com/mapbox/earcut
- optionally, you'll want to "simplify" the polygon beforehand, if you want to handle self-intersection (otherwise the triangulation might fail) https://github.com/junmer/clipper-lib
- then project all the vertices on screen and check if the point is inside the polygon (either with point-inside-polygon test https://stackoverflow.com/a/29915728, or simply with a point-inside-triangle approach)
from sculptgl.
@stephomi great thank you a lot for respond , how to finding shortest path using two points on mesh ? cos expect any librabry or good algorithm, otherwise browser will crash with high cpu
from sculptgl.
For that problem, you should probably look into A* algorithm.
It shouldn't be that expensive, but it depends of the mesh topology and polycount.
By the way you should proably ignore my previous message on the lasso/polygon thing.
I though you wanted to draw the lasso in screenspace independently of the mesh (for example like the blender selection tool).
In that case you indeed need to know the shortest points between 2 vertices.
Once you got these paths, and if your path is closed (important), simply tags all the vertices, and flood fill all the vertices inside.
It's a bit similar to this part
sculptgl/src/math3d/Picking.js
Lines 344 to 372 in 605a58c
from sculptgl.
Related Issues (20)
- Save diffuse from cylinder or torus
- Why windows only for standalone HOT 1
- Allow PWA functionality. HOT 1
- How to add simple point ?
- Updated standalone version HOT 1
- Typescript migration HOT 2
- WebGL GUI Dependency HOT 2
- Go to Sketchfab ! HOT 1
- How to import multi obj and merge combined into one obj HOT 1
- Scale size of object changes after remesh operation. HOT 2
- Cut 3d object feature in old-sculptgl Branch HOT 3
- Getting the angle of 3d object HOT 4
- Cut Feature in Sculpt-GL HOT 3
- Enter VR Button
- Updating 3D model position by giving user input
- Set pivot point to centre in exportOBJ file HOT 1
- Import issue HOT 1
- Certain Materials don't export to sketchfab.com HOT 2
- glTF import-export HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sculptgl.