I want to draw line of walls in the room using available data from RoomPlan.
I am using RoomPlan sdk to get the 3d model of a room in ios 16. Each wall is returned as a Surface object in the api that looks something like this:
Now the two most crucial piece of information is dimensions and transform. The dimensions vector is [width, height, length]
In one of the forums I read the following:
"You can use transform and dimensions parameters to draw lines. The 4 corners can be inferred from those 2 parameters: the first column of the transform is the "right" vector, and second is the "up" vector. The fourth column is the position of the wall/door/opening/window/object Combining those unit vectors with the dimensions vector will give you the corners."
Also saw someone post this code on apple site to find a door's corner points:
The central point of a door can be defined as: Point(door.transform[3].x, door.transform[3].y, door.transform[3].z)
upperLeftPoint = Point(centerPoint)
upperLeftPoint = upperLeftPoint.translate(rightV.negate(), doorWidth/2)
upperLeftPoint = upperLeftPoint.translate(upV, doorHeight/2)
I am very new to Computer Graphics and need to understand at a theoretical level what's happening here. Can anyone guide me as to how one can draw the lines for a wall / door using the given values or more specifically find the corner points of walls/doors?