Render
The Render
component allows an Entity
to render a 3D model or primitive. You can provide an Asset
or one of the primitive type . The parent entity transforms the rendered object.
Usage
This will render a simple box primitive transformed by the parent entity.
import { Render } from '@playcanvas/react/components'
Entity>
<Render type="box" />
</Entity>
Rendering an Asset
To render a 3D model loaded from a URL, you can use the asset type and pass the asset directly to the asset
prop.
import { Render } from '@playcanvas/react/components'
<Entity>
<Render type="asset" asset={asset} />
</Entity>
Last updated on