Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural geometry creation #7159

Open
willeastcott opened this issue Dec 2, 2024 · 1 comment
Open

Procedural geometry creation #7159

willeastcott opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels
area: graphics Graphics related issue feature

Comments

@willeastcott
Copy link
Contributor

willeastcott commented Dec 2, 2024

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.

@AlexAPPi
Copy link
Contributor

AlexAPPi commented Dec 2, 2024

Cool idea! I'm working on something similar, developing roads for the terrain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature
Projects
None yet
Development

No branches or pull requests

4 participants