0
$\begingroup$

Hi I am wondering how best to explain this, I am working with WebGL (effectively OpenGL) and I have the ray cast from clicking in 3d space. I have the far and near values of the ray cast, the camera position and the target it is looking at.

How do I work out where the ray cast starts and ends, effectively to draw a line to show the ray cast through 3d space. The most confusing part of this for me is the angles, subtracting the angles of the cameras face which are also in radians.

Camera position would obviously be the start point, so I need to use that and using the direction the camera is facing, along with the near and far values of the ray to get the end point! I'm confused, please help.

  • 0
    How are the angles that the camera is facing given? Then are the near and far values the distance from the camera? Do you have the camera location in 3D space, or is it take to be the origin?2010-12-30

1 Answers 1

0

Solved: I obtained the correct values from else where within the WebGL wrapper.

  • 0
    Please accept your answer so the robot doesn't keep bringing this up. To do so, check the gray check mark. Thanks2010-12-30
  • 0
    sorry it said I had to wait a long time to accept my own answer, I ended up forgetting about the post.2011-01-10