playcanvas / playcanvas/engine
Procedural geometry creation
@kpal81xd is already working on this.
Since Dec 2, 2024.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
The engine has some basic functionality to create a Mesh via the Geometry class. There are some subclasses of Geometry to create specific shape types (box, sphere, etc). However, we could augment geometries to be far more powerful.
Let's say we start out with some kind of API to define a 2D path. This could be use to define polygons (and holes in polygons). Then you could apply 'modifiers' (as they are known in 3DS Max) to manipulate the polygons somehow. Examples could be:
- Triangulate
- Extrude
- Bevel
- Subdivide
- UV Unwrap
- ...and so on.
Using this system, in just a few lines of JS, I could define a very simple path (let's say a five-pointed star), extrude it, bevel it, apply a nice material and procedurally generate a very nice looking geometric shape. I could also build a powerful 3D text system which starts out creating a path using outlines defined in a TTF font. I could also load an SVG say (of a logo perhaps) and trivially turn it into a 3D shape.
What would be good is to design a general-purpose framework for adding these modular modifiers/ops over time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.