Posted By: Rackscha
get the point where a line crosses an imaginary plane? - 08/23/11 13:48
Hi,
When i have my mousecursor at the screen. I can use the direction to send a trace. But how can i determine if my line cuts a plane?
For this specific situation:
Iam looking at my surface made out of different cubes(atm).
Now i need to calculate which cube is below my cursor to select it. Since i might consider using a single mesh later, i cannot use something like SHOOT. i need to calculate the point where my cursor trace hits the same plane as my surface.
Bets ist, if its entity independend.
Maybe someone has an idea?
EDIT: since all of my blocks are aligned on my grid, i just need the global position to calculate the required block.
When i have my mousecursor at the screen. I can use the direction to send a trace. But how can i determine if my line cuts a plane?
For this specific situation:
Iam looking at my surface made out of different cubes(atm).
Now i need to calculate which cube is below my cursor to select it. Since i might consider using a single mesh later, i cannot use something like SHOOT. i need to calculate the point where my cursor trace hits the same plane as my surface.
Bets ist, if its entity independend.
Maybe someone has an idea?
EDIT: since all of my blocks are aligned on my grid, i just need the global position to calculate the required block.