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

Add a gizmo system #2904

Closed
willeastcott opened this issue Feb 23, 2021 · 4 comments · Fixed by #5928
Closed

Add a gizmo system #2904

willeastcott opened this issue Feb 23, 2021 · 4 comments · Fixed by #5928
Assignees
Labels
area: graphics Graphics related issue feature

Comments

@willeastcott
Copy link
Contributor

willeastcott commented Feb 23, 2021

The Editor has a great translate/rotate/scale gizmo.

gizmo

It would be great if the engine supported a generic gizmo system that could be shared between various applications. Here are some feature I would like to support in this system:

  • Shouldn't be dependent on framebuffer picker (because this relies on the GPU and is inefficient). Just use math to perform ray-intersection tests.
  • Support translate/rotate/scale but potentially any type of gizmo that could depend on hover and pick+drag type input.
  • Configurable graphical representation (size on screen, thickness/size of graphical elements, etc)
  • Shading controls (flat shaded vs lit)
@willeastcott willeastcott added feature good first issue Good for newcomers area: graphics Graphics related issue and removed good first issue Good for newcomers labels Feb 23, 2021
@kungfooman
Copy link
Collaborator

More like a general question, would code from Three.js or Babylon be welcome?

image

The example is here: https://threejs.org/examples/misc_controls_transform.html
Actual code is here: https://threejs.org/examples/jsm/controls/TransformControls.js

It would only require like 20 "polyfills" for the Three.js imports.

There is also more code I would like to use in PlayCanvas, like their FBX importer and glTF exporter.

@willeastcott
Copy link
Contributor Author

I don't think we'll need to use that code. I've got most of the Editor code extracted in this project:

https://playcanvas.com/project/768040/settings

Next, I'm going to replaced the framebuffer picker with ray-triangle intersection tests for the gizmo. This should be more performant and make it easier to use in an XR app.

I agree that adding a glTF exporter would be very valuable. But that's a different issue. Again, I don't think we need to take code from anywhere to implement that.

@mvaligursky
Copy link
Contributor

For the picking, perhaps we could resurrect this one #989

@willeastcott
Copy link
Contributor Author

Yes. We should. I'm gonna put a simple ray-triangle function into my gizmo script for now though. BTW, it should be easier to write the code to do Mesh/Ray intersection now, since you added Mesh#getPositions/getIndices.

@willeastcott willeastcott self-assigned this Mar 6, 2021
@willeastcott willeastcott changed the title Add a gizmo script Add a gizmo system Dec 27, 2023
@kpal81xd kpal81xd mentioned this issue Jan 5, 2024
16 tasks
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

Successfully merging a pull request may close this issue.

4 participants