g-plugin-3d
Previous
g-plugin-css-select
Next
g-plugin-device-renderer
Loading...
This plug-in can be introduced when 3D graphics are needed in the scene, and it has some common 3D graphics built in.
3D graphics drawing is only supported by the g-webgl
and g-webgpu
renderers.
import { Renderer as WebGLRenderer } from '@antv/g-webgl';// Creating a WebGL rendererconst webglRenderer = new WebGLRenderer();
Then you need to register the 3D plug-in.
import { Plugin } from '@antv/g-plugin-3d';webglRenderer.registerPlugin(new Plugin());
Finally, specify this renderer when creating the canvas.
import { Canvas } from '@antv/g';const canvas = new Canvas({container: 'container',width: 600,height: 500,renderer: webglRenderer, // 指定 WebGL 渲染器});