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

Ensure Three.js origin aligns with the Lume origin (top/left of viewport by default) #280

Open
trusktr opened this issue Oct 15, 2023 · 1 comment
Labels

Comments

@trusktr
Copy link
Member

trusktr commented Oct 15, 2023

Currently the default (0,0,0) is at the top left of the screen (just like CSS and DOMMatrix, the same coordinate system), but the implementation of this actually has the Three.js origin in the middle of the screen. This is not good because some default features of Three.js rely on the origin for default behaviors.

For example, directional lights get their direction based on their position vector from the world origin by default, so a default <lume-directional-light> with Lume position (0,0,0) actually has an underlying Three.js position of (-windowWidth/2,windowHeight/2) which means that the default direction of a directional light is downward/rightward.

@trusktr trusktr assigned trusktr and unassigned trusktr Oct 15, 2023
@trusktr trusktr added the bug label Oct 15, 2023
@trusktr
Copy link
Member Author

trusktr commented Oct 15, 2023

Labeled as bug, because the behavior currently deviates from Three, and will not make sense if you know Three (you'd have to know how Lume coordinate system maps to the Three coordinate system, and we don't expect people to need to know that, its an implementation detail)

@trusktr trusktr changed the title refactor math so that the underlying Three.js origin aligns the Lume origin (top/left of viewport by default) Ensure Three.js origin aligns with the Lume origin (top/left of viewport by default) May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant