Skip to content

Conversation

@mindlapse
Copy link
Contributor

Hi mrdoob,

I really like your work. I implemented 3d click detection / event handling.

  • The new examples/hci_clickcube.html provides a good demo.
  • More method chaining was introduced.
  • The code isn't completely optimized or clean.
  • The code is isolated to the HCI directory (named after Human Computer Interaction)

I'd like to discuss any changes you would like to see. I like the potential this has for making usable 3d web pages.

mindlapse

@mrdoob
Copy link
Owner

mrdoob commented Sep 30, 2010

This is awesome! :O Thanks for taking the time!

I wonder if the SelectableFace*.js are needed though. And somehow I think it could be nice if this could be moved to the /core folder as Traverse or Unproject... or maybe moved to /scenes and renamed to SceneTraverse or something like that? Just to make it more open/abstract (you may just want to check if there is something under a specific X,Y position with nothing to do with a user click...

What do you think?

@mindlapse
Copy link
Contributor Author

Yes I like the sounds of it,
I could take out the debug mode and do a couple optimizations like using bounding spheres around complex objects, and simplify the math somehow, Unproject to a Ray sounds good. I agree that the SelectableFace* isn't really needed. Faces could either each have a 'selectable' true/false attribute or faces could register themselves in a set of faces available to select (probably more efficient. Also, I like the idea of abstracting away the camera to 'unproject' along any normal to find intersections (often the nearest) in 3d, but then there should be an adapter that uses the camera to make it convenient to implement for regular mouse move/click applications

@mindlapse
Copy link
Contributor Author

on the other hand, abstracting it away from the camera might be over-abstracting it, because it's difficult to think of a way that it could be useful outside of the context of a camera and 3d projection. Maybe an XYUnprojection... although we don't want to lose the audience in abstractions, so an XYUnprojection could do the transform, and vectors could check for the nearest intersect among faces, and all of it could be tied together in a ClickResolver (or something that ties it all together)

@mindlapse
Copy link
Contributor Author

or better: Rays (2 vectors, position + direction) would check for the nearest intersect among faces.

@mrdoob
Copy link
Owner

mrdoob commented Sep 30, 2010

Unproject + Ray sounds good to me. I'll try to merge and move the stuff around.

The idea of Three is to find the right balance between simplicity and extensibility. As an example, there is no VideoMaterial. There is a example that shows how to achieve it using BitmapUVMappingMaterial and <video>.

Otherwise the library would end up being too big with many helpers inside of it that may or may not be of use in a lot of cases.

@mrdoob
Copy link
Owner

mrdoob commented Nov 4, 2010

Merged and refactored.
9a62d11

threejsworker pushed a commit to threejsworker/three.js that referenced this pull request Feb 27, 2017
Fixed itemsize to display all cubes
godlzr pushed a commit to godlzr/three.js that referenced this pull request Mar 15, 2017
asajeffrey pushed a commit to asajeffrey/three.js that referenced this pull request Jul 28, 2020
mrxz pushed a commit to mrxz/three.js that referenced this pull request Jan 31, 2025
* Update WebXRManager.js

* Update WebGLRenderer.js

* Update WebGLRenderer.js

deleted useless blank lines

* Update WebXRManager.js

- Deleted useless code and blank lines
- refectored _getRenderTarget to getRenderTarget

* Update WebGLRenderer.js

Reflect the refactoring of getRenderTarget function
mrxz pushed a commit to mrxz/three.js that referenced this pull request Feb 2, 2025
* Update WebXRManager.js

* Update WebGLRenderer.js

* Update WebGLRenderer.js

deleted useless blank lines

* Update WebXRManager.js

- Deleted useless code and blank lines
- refectored _getRenderTarget to getRenderTarget

* Update WebGLRenderer.js

Reflect the refactoring of getRenderTarget function

Improve compatibility of Post-Processing with VR (mrdoob#23)

* Update EffectComposer.js for better compatibility with VR

* Update Pass.js for better compatibility with VR
mrxz pushed a commit to mrxz/three.js that referenced this pull request Aug 14, 2025
* Update WebXRManager.js

* Update WebGLRenderer.js

* Update WebGLRenderer.js

deleted useless blank lines

* Update WebXRManager.js

- Deleted useless code and blank lines
- refectored _getRenderTarget to getRenderTarget

* Update WebGLRenderer.js

Reflect the refactoring of getRenderTarget function

Improve compatibility of Post-Processing with VR (mrdoob#23)

* Update EffectComposer.js for better compatibility with VR

* Update Pass.js for better compatibility with VR
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants