hope you are doing well. I have a problem regarding placing the 2D rectangles in a 3D space. I have a CATIA software in which there are a few rectangle boxes that I need to place along the border of the screen, as shown in the image.
The dotted rectangles shows the boxes in CATIA, and the solid rectangles are where I need to place them. The problem here is, the rectangles are 2D, and the CATIA screen in a 3D space. I could not place them at the right location and I need your help.
Here is my approach:
I get the center point of the screen, which is a 3D point.
Get the 2 3D vectors(Up direction, right direction of the screen)
Compute the coordinates of corners of the screen by moving the 3D center point of the screen, by a distance equal to half the width, half the height of the screen, along the 2 vectors.
Equate the top right coordinate of the 2D rectangle to top right 3D coordinate of the screen.(which is giving the wrong output)
Move the second rectangle below the first rectangle, continue the for loop till all the rectangles are placed along the border of the screen.
Another thing to notice here is, the dotted rectangles can be located along the xy plane or yz plane or xz plane. And the 3D plane which is parallel to the screen can be computed. My question would be, how can I convert the 2D rectangle coordinates to 3D coordinates, so I can move them to the right location in 3D space. Thanks in advance for your help.