You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
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.The text was updated successfully, but these errors were encountered: