I’m defining a flat wall as a center pos (cx,cy,cz), a normal (nx,ny,nz), a vector pointing to the up-direction of the wall (ux,uy,uz) it’s width and length (w,l). How do I find the position of it’s 4 vertexes?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ll assume that by length, you mean height. First, make sure that your up and normal vectors are normalized. You can multiply the up vector by the length, and add and subtract the result from the center to get the temporary results A and B, respectively.
Then, cross product the up vector with the normal vector to get the right vector (or left, depending on what order you do the cross product). Then multiply the right vector by the width, and add and subtract this from the center to get two more temporary results, C and D, respectively.
Finally, the four corners of the quad can be obtained by adding each of C and D to each of A and B.