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

Intuitive Design #20

Open
psytron opened this issue Feb 20, 2023 · 4 comments
Open

Intuitive Design #20

psytron opened this issue Feb 20, 2023 · 4 comments

Comments

@psytron
Copy link

psytron commented Feb 20, 2023

We are excited to find your great library. We noticed the documentation mentions https://github.com/jasonChen1982/three.interaction.js
which is really intuitive lib, it just drops in and worked until it stopped being maintained.

We noticed that the api for three.interactive is almost identical, with one exception,
this lib requires:

interactionManager.add(cube);

With three.interaction this repeating interactionManager.add(object) call isn't necessary, so using it felt intuitive and easy throughout the application. Meanwhile three.interactive requires passing reference to the manager around everywhere and calling add() for every object? Why not make it automatically add itself just like three.interaction?

@markuslerner
Copy link
Owner

Hi @psytron, thank you for your feedback. I know it would be more convenient, but the manual approach gives you more control and it used to be faster than the auto magic three.interaction.js uses. three.interaction.js also patches three's Object3D and EventDispatcher, which I tried to avoid.

Maybe I can still add an "autoAdd" option and pass the scene to the interactionManger. In any case this would decrease performance due to increased object iterations. Not sure if the performance degradation would be notable though.

@psytron
Copy link
Author

psytron commented Feb 22, 2023

+1 autoAdd() would be awesome!

const interactionManager = new InteractionManager(
  renderer,
  camera,
  renderer.domElement , { autoAdd:true } 
);

You mean something like that?

I think your idea would be best of both worlds.
Artists and experimenters could do rapid prototyping and fast auto-magic interactivity.
While deeper architects could choose manual transmission for performance optimization later.

@markuslerner
Copy link
Owner

Hi @psytron, I just added the autoAdd option and published release v1.6.1.
I also created an auto-add example.
Please let me know, if it works as excepted or if you find any issues.

@psytron
Copy link
Author

psytron commented Nov 5, 2023

Thanks @markuslerner excited about this feature!

Testing it so far the performance of {autoAdd:true} really affects the frame rate: My animation goes from 60 FPS to 1 FPS , so the app becomes unusable.

This does not happen with THREE.interaction (this older library somehow enables the autoAdd functionality without the performance drop )

Perhaps it is something with the latest Revision of THREE.JS , currently testing it with REV 158.

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

No branches or pull requests

2 participants