Note that there are some explanatory texts on larger screens.

plurals
  1. POCalculating point relative to another point in 3D space
    primarykey
    data
    text
    <p>This is going to be a rather complicated explanation so bear with me. In 3D space, a player has 2 rotation values for looking around them, the rotation about the x and y axis. Given a view distance, I have calculated the point in the center of the players view port which is the view distance away (as show below).</p> <p><img src="https://i.stack.imgur.com/oJcjS.png" alt="enter image description here"></p> <ul> <li>'vd' is the view distance</li> <li>'c' is a value holder</li> <li>'(x,y,z)' is the point to be calculated</li> <li>'rot.x' and 'rot.y' are the rotations about the x and y axis, respectively.</li> </ul> <p>Given this point (x,y,z), I need to calculate four points relative to this position (as shown below)</p> <p><img src="https://i.stack.imgur.com/Tbf0X.png" alt="enter image description here"></p> <ul> <li>'(x2,y2,z2)', '(x3,y3,z3)', etc. are the points I need to calculate.</li> <li>The width and height of the green plane is known. Let's call each one 'w' and 'h' respectively.</li> </ul> <p>Now given I still have access to all the values in the first graph (such as rotations, etc), how can I calculate the each of the four points?</p> <p>A little background.. I am doing this for a culling method called frustum culling. I am trying to do this with LWJGL in order to speed up rendering and reduce the toll on the GPU. I haven't been able to figure out the trigonometry for this calculation, and I have been trying for the past few hours. Any help is appreciated. If any more explanation/clarification is needed, just let me know. Thanks.</p> <p>EDIT: Also, the points have to be on the same plane and rotate about the x and y axis with the point (x,y,z). </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload