Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Can't using picking while in isometric projection #11

Open
fesoliveira014 opened this issue Dec 11, 2016 · 1 comment
Open

Can't using picking while in isometric projection #11

fesoliveira014 opened this issue Dec 11, 2016 · 1 comment
Labels

Comments

@fesoliveira014
Copy link
Owner

No description provided.

@fesoliveira014
Copy link
Owner Author

Got this to partially work. The problem was caused due to the way rays should be created in different projections: when in perspective projection, the origin of a ray is fixed as the camera position, while it's direction is defined by the vector (origin - unprojected mouse position); when in orthogonal (or isometric in our case) projection, the origin is defined by the unprojected mouse position, while the direction is the difference between the origin and the "end", which is the mouse position, (x,y), unprojected on the far side of the depth buffer, in this case, -1. Thus, for an isometric projection, the ray is defined as (unproject(x,y,0), unproject(x,y,-1) - unproject(x,y,0)).

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

No branches or pull requests

1 participant