I'm trying to use data returned from the RoomCaptureSession delegate to draw four corners of a door in SceneKit.
The CapturedRoom.Surface class has Dimensions and Transform members.
I was told in the WWDC 2022 RoomPlan Slack lounge:
"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."
So I think this is a basic vector question. I'm not sure what is meant by "Combining those unit vectors with the dimensions vector". I've tried a few things, but I'm not sure how to go about this.
So this is how I pulled something of kind of quick and dirty.
The dimensions vector is [width, height, length]
And the central point of the door can be defined as: Point(door.transform[3].x, door.transform[3].y, door.transform[3].z)
I'm seeing the length come up as zero for doors.
So I defined the upper left point as:
upperLeftPoint = Point(centerPoint)
upperLeftPoint = upperLeftPoint.translate(rightV.negate(), doorWidth/2)
upperLeftPoint = upperLeftPoint.translate(upV, doorHeight/2)