In my Radiance exporter, when exporting the bodies one by one, I can't seem to get the transformation for the Windows and/or Doors right.
I start from a list of body-indices.
Then I request the API_Component3D.
From the component, I can query vertices & edges & Polygons and also the "tranmat" (the transformation matrix).
I was trying to derive transformation, scaling & rotation out of it and it seems to work fine for regular objects (e.g. chairs), but they only have a Z-rotation.
I used the function "Geometry::TM2dDecompose" which gave me the correct Z-angle, but I guess this is not usable for the Windows or Doors.
Can I request the actual rotation values around the different axes?
Or should I receive this from the Wall in which they are located?
API_Elem_Head parent = component.body.parent; bool IsWindowOrDoor = false; if (parent.typeID == API_WindowID || parent.typeID == API_DoorID) IsWindowOrDoor = true;Would it make sense to request the window's rotation from the wall it is inserted in? Can I access that?
stefan wrote:Would I be correct in thinking that you could simply transform the 3D vertices to their true orientation and export them with the x/y/z rotations set to 0?
But what do you exactly mean by "applying the tranmat to the 3D Datastructure"? Transform a vector and see what angle it gives me?
What I need to do in my exporter is to give the correct X, Y & Z rotation for each object (in degrees), since the polygons are given in local coordinates.
But what do you exactly mean by "applying the tranmat to the 3D Datastructure"?