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

Feature Request - Grouping sprites to share the same transform point #7941

Closed
karimbeyrouti opened this issue Jan 11, 2016 · 6 comments
Closed

Comments

@karimbeyrouti
Copy link
Contributor

This is a question / issue I raised on stack overflow which I think could be a feature: http://stackoverflow.com/questions/34724279/grouping-three-sprite-to-share-the-same-transform-point

Looking at the Three API, I cannot see anything obvious that would help solve this. Hopefully this is something that would also help others: Being able to group sprites to share the same centre of rotation / transform. Maybe this could use the THREE.Group object to group the sprites ?

Thank you for all the lovely work on Three.JS so far.

@mrdoob
Copy link
Owner

mrdoob commented Jan 13, 2016

Can you create a jsfiddle we can work with/study?

@karimbeyrouti
Copy link
Contributor Author

Certainly: https://jsfiddle.net/karimbeyrouti/4qt6Ljgt/2/

A little info:
The JS Fiddle creates a rows of Sprites: bullet point + longer sprite for label.
You can toggle camera position by clicking on the output - or wait 1.5 seconds for camera to toggle.

The issue here: would be great if the red bullet points would stay aligned with their blue label. Maybe a good way of grouping their transform pivot would be to use a THREE.Group ( instead of Object3D ) ? .

@WestLangley
Copy link
Collaborator

@karimbeyrouti You are passing pixels units into your OrthographicCamera constructor. What are your world units? Why are you moving the camera?

@karimbeyrouti
Copy link
Contributor Author

I am moving the camera, because our app animates the view from top down to isometric. Our world units are screen space pixels, or at least what is what I was aiming for ( and it seems to be working nicely ).

@WestLangley
Copy link
Collaborator

Our world units are screen space pixels

Hmmm... I haven't seen that before... http://stackoverflow.com/a/17567292/1461008

In any event, can you add OrbitControls to your example. I am trying to understand what the feature should be. Are your sprites in world-space, or in a planar HUD in front of the scene?

@karimbeyrouti
Copy link
Contributor Author

The sprites are indeed in world space, in our app groups of sprites form part of node of in a graph. At the moment I have stopped using sprites in favour of planes, and am copying the Quaternion from the camera (which is a lot easier to manage). However it would have been optimal to use sprites and be able to group them so a number of these could share a pivot point / transform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants