Original Post
Hi,
I am trying to implement a Laser beam and use ray tracing to detect the collision.
In the figure it can be seen that if the beam is in 'A' position then there is no collision and when the Laser is in
'B' position then the collision is detected and it is indicated by turning into red.
but when the laser is rotated then the same collision is not working as in the case of 'C'
For ray I am using t = startPoint + t * direction; equation
The problem I am seeing is that the calculation of start point position
THe start point of the ray is different in the case of 'C' but after using glRotatef() when I try to fetch the start point value
it gives the position same as in the case of 'A' and 'B'
How to find the updated position after rotation or is there any alternative way of doing it.
All suggestions are welcome
I am trying to implement a Laser beam and use ray tracing to detect the collision.
In the figure it can be seen that if the beam is in 'A' position then there is no collision and when the Laser is in
'B' position then the collision is detected and it is indicated by turning into red.
but when the laser is rotated then the same collision is not working as in the case of 'C'
For ray I am using t = startPoint + t * direction; equation
The problem I am seeing is that the calculation of start point position
THe start point of the ray is different in the case of 'C' but after using glRotatef() when I try to fetch the start point value
it gives the position same as in the case of 'A' and 'B'
How to find the updated position after rotation or is there any alternative way of doing it.
All suggestions are welcome