jagenjo / webglstudio.js

A full open source 3D graphics editor in the browser, with scene editor, coding pad, graph editor, virtual file system, and many features more.
MIT License
5.22k stars 606 forks source link

[Feature] ability to edit 3D meshes #39

Open brylie opened 5 years ago

brylie commented 5 years ago

We are researching 3D editors for WebGL that allow users to create and edit 3D meshes. E.g. we would like to be able to do things like move edges/verticies, divide faces, etc.

After adding a default cube, how do I edit its mesh?

jagenjo commented 5 years ago

WebGLStudio doesnt have mesh editing capabilities (maybe one day...)

Its main goal is to create 3D applications, but meshes must be imported from any 3D software. I suggest you to check clara.io which is more a 3D meshes editor.

Cheers

brylie commented 5 years ago

I had found clara.io, but it is not open source. In effect, this is a feature request to be able to edit meshes with WebGL Studio, but I wasn't sure to what extent the ability existed. Please re-open the issue, since it is a feature request.

jagenjo commented 5 years ago

ok, but Im the sole developer of WebGLStudio and I dont have plans to add that feature (it will take one year of work to develop it), so do not expect it to be available in quite some time.

brylie commented 5 years ago

That makes sense. We may be able to help. What would be some sub-tasks for the feature?

jagenjo commented 5 years ago

I can make an skeleton for the mesh editor, but you will have to code the actions like:

The main problem is that my mesh structure is not meant for editing, in the sense that it just packs all the vertices in an array (focused on rendering performance), and to edit meshes you usually want to have a structure that has info like neighbour triangles, etc.

If you do not have experience it could take some time, thats why I never bothered trying, but if you are commited to the idea Im willing to help.

brylie commented 5 years ago

The main problem is that my mesh structure is not meant for editing, in the sense that it just packs all the vertices in an array (focused on rendering performance), and to edit meshes you usually want to have a structure that has info like neighbour triangles, etc.

Might it be good to add an 'edit mode' toggle (for a selected mesh), so the default representation could be performance optimized, while edit mode would switch to a more topology-based representation? E.g. this is similar to the Blender modelling experience.

jagenjo commented 5 years ago

yes, thats what I was thinking, it shouldnt be hard to have a property inside every mesh for a geometric representation of itself (triangles, edges, vertices), and methods to convert from one to the other.

I was just saying it to showcase the complexities of editing.

brylie commented 5 years ago

it shouldnt be hard to have a property inside every mesh for a geometric representation of itself (triangles, edges, vertices), and methods to convert from one to the other.

OK, should that be a sub-task or separate feature request?

jagenjo commented 5 years ago

because that representation is totally tied to the editor itself, the person in charge of doing it should decide how he wants to structure it. I do not have experience with mesh editing so I dont know what are the best way to structure it.

The main problem is that for complex meshes (with thousands of vertices) if that structure is not accelerated (using some sort of spatial partitioning) it could be a little bit slow because for every click you have to traverse all the faces. Although we could asume small meshes to start.

coderofsalvation commented 4 years ago

blender3d is the king of mesh editing. Unity3D neither supports such features, hence they just point people to blender3d. Imho implementing such features would not be the best focus for webglstudio. Blender3d & webglstudio is a perfect👌 combination, both free and opensource.

kalwalt commented 4 years ago

I agree with you @coderofsalvation, of someone want to edit a mesh modify it with blender3d.