当前位置: 首页 > 文档资料 > A-Frame 中文文档 >

<a-obj-model>

优质
小牛编辑
122浏览
2023-12-01

We recommend glTF for distributing assets in production over the web. Check out using the glTF component. You can either instead export to COLLADA and use the converter or try out the OBJ converter.

The .OBJ model primitive displays a 3D Wavefront model.

Example

<a-scene>  <a-assets>    <a-asset-item src="crate.obj"></a-asset-item>    <a-asset-item src="crate.mtl"></a-asset-item>  </a-assets>  <!-- Using the asset management system. -->  <a-obj-model src="#crate-obj" mtl="#crate-mtl"></a-obj-model>  <!-- Defining the URL inline. Not recommended but may be more comfortable. -->  <a-obj-model src="crate.obj" mtl="crate.mtl"></a-obj-model></a-scene>

Attribute

AttributeComponent MappingDefault Value
mtlobj-model.mtlnull
srcobj-model.objnull

Troubleshooting

If you don’t see your model, try scaling it down. OBJ models generally have extremely large scales in comparison to A-Frame’s scale.