Translating an svg PShape with different renderer

I created a PShape object that had different children under it. I iterate through the shapes and then translated them with the regular renderer. To translate each piece to where i wanted it to go (the middle of the screen), i had to additional translate each piece by half of the image's width and height. No real issues.

Then, I switched the renderer to P3D, and all of a sudden, it was translating things differently. Only four out of the five pieces were relatively correct in relation to each other and all of the pieces were not in the middle of the screen anymore, despite the only thing I changed was the renderer.

Any suggestions? Does the P3D render handle translation of svg shape objects in a different way?



  • Here's something else I noticed. when i do a println where pp is the individual child in a loop, and p2 is the main svg, they output different things depending on wwhihc renderer println(i + " " + (pp.width) + "," + pp.height + "--" + p2.width + "," + p2.height); p2 always showst he correct width and height of the svg image in both cases. in the default renderer, pp.width and pp.height hav ea value of zero. in the p3d renderer, each of these has width and height value.

  • edited June 2016

    Furthermore, the numbers for the width and height for each child in the p3d renderer do not actually exist anywhere in the svg file. the only thing that does exist is the p2.width p2.height which actually is in the xml of the .svg file. I don't know where the values for width and height are coming from for the children.

  • I doubt you'll get an answer without posting a runnable example.

  • I decided to go with Geomerative. No issues with that in the P3D renderer.

Sign In or Register to comment.