Exporting a 3D plot into a 3D viewing format and axis scaling

I've been trying to export a Plot3D into an X3D (JVX, VRML) file using the Mathematica's Export function. The problem is that when the PlotRange is large compared to the other two dimensions the output is essentially stretched into a thin line. Is there a way to maintain the original scaling?

Try the following:

Export["file.x3d", Plot3D[x^2+y^2,{x,-10,10},{y,-10,10}]];


The VerticalAxis option does not seem to help...

Thanks.

-

The "original scaling" of the displayed plot in Mathematica is determined by the BoxRatios setting for the plot, so it isn't intrinsic to the surface you're trying to export. When you export the plot, only the mesh is kept, with its actual 3D coordinates and without the scaling due to BoxRatios.

Therefore, if you want to export the surface in a "squished" form, you'll have to do the squishing yourself:

p = Plot3D[x^2+y^2,{x,-10,10},{y,-10,10}];
With[{zScale = .05},
Export["squishedPlot.wrl",
p /. Graphics3D[gr_, opts___] :>
Graphics3D[
GeometricTransformation[gr, ScalingTransform[{1, 1, zScale}]],
opts]]
]


I checked that this produces the desired "aspect ratio" by importing the file into Blender.

-