此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)
Import/Export 导入/导出 格式

X3D (.x3d)

MIME type: model/x3d+xml
Web3D geometry format.
Used for distributing 3D models on the web and in media applications.
XML format.
Can store multiple geometries.
Introduced in 2003, maintained by the Web3D Consortium.
Successor of the VRML format.
  • Export supports the X3D format Version 3.0.
  • Export["file.x3d", expr, elem] creates an X3D file by treating expr as specifying element elem.
  • Export["file.x3d", {expr1, expr2, ...}, {elem1, elem2, ...}] treats each expri as specifying the corresponding elemi.
  • Export["file.x3d", expr, opt1->val1] exports expr with the specified option elements taken to have the specified values.
  • Export["file.x3d", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Export.
  • Data representation elements:
"Graphics3D"X3D file containing 3D geometries, represented as a Graphics3D object
"GraphicsComplex"list of GraphicsComplex objects, each representing a geometry stored in the file
"LineData"lines represented as lists of indices, referencing the vertices as given by the "VertexData" element
"LineObjects"list of Line primitives given in absolute coordinates
"PointData"point data in indexed form
"PointObjects"list of Point primitives given in absolute coordinates
"PolygonData"polygon data in indexed form
"PolygonObjects"list of Polygon primitives given in absolute coordinates
"VertexData"list of vertex coordinates
"VertexNormals"normal vectors corresponding to the vertices given by "VertexData"
  • Advanced options:
"InvertNormals"Falsewhether to invert the orientation of vertex normals
"VerticalAxis"{0,0,1}orientation to assume for the coordinate system used in the file
  • By default, Mathematica assumes that in the coordinate system used by the X3D format the vertical axis corresponds to the third coordinate.
  • With the setting "VerticalAxis"->{0, 1, 0}, Mathematica will apply the transformation {x, y, z}->{x, z, -y} to all graphics coordinates when exporting to X3D.