ofBeginSaveScreenAsSVG & 3D

Hi there!

I’m trying to do 3D transforms with ofPushMatrix/ofPopMatrix, and noticing that the z-axis transformations aren’t outputting correctly. My code is below:

void ofApp::draw(){
  if (exportSVG == 1) {
    ofBeginSaveScreenAsSVG("test.svg", false, true);
  }
  
  ofFill();
  ofSetColor(ofColor::blue);
  ofPushMatrix();
  ofTranslate(200.0, 500.0, 200.0);
  ofDrawTriangle(0, 0, 0, 50.0, 50.0, 25.0);
  ofPopMatrix();
  
  ofPushMatrix();
  ofTranslate(200.0, 200.0, 0.0);
  ofDrawTriangle(0, 0, 0, 50.0, 50.0, 25.0);
  ofPopMatrix();
  
  if (exportSVG == 1){
    ofEndSaveScreenAsSVG();
    exportSVG = 0;
  }
}

When I view this on screen, I see what I expect — one triangle smaller than the other. But when I check the outputted SVG I get both triangles being the same size:

Am I missing something? Looking at the definition it seems like all I need to do to make a 3D SVG file is to call the right boolean, but maybe this doesn’t work with ofTranslate in the way I imagine it should…

J