I’ve got some code that’s building geometry for a house. It builds the walls and roof separately and combines them:
// Extrude centers on the origin so half the walls will be below ground geom::SourceMods walls = geom::Extrude( shapeFrom( outline ), height, 1.0f ).caps( false ) >> geom::Translate( vec3( 0, 0, height / 2.0f ) ); // Raise the roof to the top of the building roof = RoofMesh( outline, roofStyle, slope, overhang ) >> geom::Translate( vec3( 0, 0, height ) ); return roof & walls;
RoofMesh is a custom
geom::Source I wrote that built the vertexes and indexes by hand. This was all working correctly, putting the pieces in the right spot.
I decided to replace
RoofMesh with a smaller functions that generated the top and sides of the roof as two
TriMesh objects which are merged together:
return geom::SourceMods( buildRoofFields( arrRoofFaces ) ) & buildRoofGables( arrRoofGables );
The problem is that now the transformation are being combined. Before I could move the roof and wall separately, now the transformations seem to be applied after the geometry is merged:
Is there a way to force the modifiers to be applied? Or perhaps an alternate order to the
<< operations that will get around this?