blender-motion-state-inspection
AFaffaan-m/ECC278k近 7 天新增 4,046 个 star
Guide external npm package users and AI coding agents integrating @manycore/aholo-viewer into web applications. Use when asked to install, bootstrap, render 3D Gaussian Splatting or mesh content, configure cameras, scenes, lighting, viewer pipeline options, or write TypeScript examples for the public @manycore/aholo-viewer npm package.
Use this skill to build or modify user applications that consume the public @manycore/aholo-viewer npm package. Treat it as a full-featured browser rendering package, not as this repository's internal renderer source.
Before generating non-trivial code, read the AI-oriented docs advertised by https://aholojs.dev/llms.txt:
https://aholojs.dev/llm/manual/getting-started.md for installation and the minimal Vite setup.https://aholojs.dev/llm/manual/basic-concepts.md for scenes, objects, cameras, viewports, and the render flow.https://aholojs.dev/llm/api/index.md to confirm public exports.https://aholojs.dev/llm/examples/index.md for runnable TypeScript patterns.Prefer these Markdown docs over scraping rendered HTML pages.
Install the package in a browser app:
npm install --save @manycore/aholo-viewer
npm install --save-dev vite typescript
Import only public package exports from @manycore/aholo-viewer.
Create a real DOM container with stable dimensions before calling createViewer. Attach application DOM event listeners to this container, not to the engine canvas.
Create a camera, position it, call lookAt, add objects to viewer.getScene(), then call viewer.setCamera(camera).
Configure rendering with setViewerConfig(viewer, { pipeline: ... }).
Render explicitly with viewer.render(). If the app relies on viewer-triggered invalidation, set viewer.requestRenderHandler to schedule another render with requestAnimationFrame.
Clean up when removing content: detach scene objects, stop render/update loops that still reference them, then release GPU resources or owned resources according to the cleanup rules below.
Use this pattern for a Vite/TypeScript browser entry:
import {
BackgroundMode,
Color,
PerspectiveCamera,
SplatLoader,
SplatUtils,
Vector3,
createViewer,
setViewerConfig,
} from '@manycore/aholo-viewer';
const SPLAT_URL = 'https://holo-cos.aholo3d.cn/aholo-opensource/gs_file/bear/bear.3d71a266.sog';
const container = document.createElement('div');
container.style.width = '500px';
container.style.height = '500px';
document.body.appendChild(container);
async function main() {
const viewer = createViewer('example-viewer', container, {});
const camera = new PerspectiveCamera(60, 1, 0.1, 2000);
const response = await fetch(SPLAT_URL);
const buffer = await response.arrayBuffer();
const data = await SplatLoader.parseSplatData(
SplatLoader.SplatFileType.SOG,
new Uint8Array(buffer),
SplatLoader.SplatPackType.Compressed,
);
const splat = await SplatUtils.createSplat(data);
camera.up.set(0, -1, 0);
camera.position.set(-1.5, -0.5, 0);
camera.lookAt(new Vector3(0, 0, 0));
viewer.getScene().add(splat);
viewer.setCamera(camera);
setViewerConfig(viewer, {
pipeline: {
Background: {
background: {
active: BackgroundMode.BasicBackground,
basic: { color: new Color(0, 0, 0) },
},
ground: { enabled: false },
},
Splatting: { enabled: true },
TAA: { enabled: false },
},
});
const render = () => viewer.render();
viewer.requestRenderHandler = () => requestAnimationFrame(render);
requestAnimationFrame(render);
}
main();
createViewer, setViewerConfig, Viewer, Viewport.PerspectiveCamera, OrthographicCamera, Vector2, Vector3, Vector4, Color, Matrix4, Quaternion.Object3D, Scene3D, Mesh, Splat, AmbientLight, DirectionalLight, PointLight, SpotLight.BufferGeometry, BufferAttribute, MeshBasicMaterial, MeshPhongMaterial, Side, downloadTexture.SplatLoader, SplatUtils, CompressedSplat, SuperCompressedSplat, SogSplat.GLTFLoader, DracoLoader, Animation, Events.Confirm exact symbols in /llm/api/index.md when using less common APIs.
For 3DGS content:
SplatLoader.parseSplatData(...) to parse supported splat formats.SplatUtils.createSplat(data) to create a renderable splat.pipeline.Splatting.camera.up.set(0, -1, 0).For mesh content:
BufferGeometry, BufferAttribute, and optional indices.MeshPhongMaterial with lights for shaded meshes, or MeshBasicMaterial for unlit objects.AmbientLight, DirectionalLight, or PointLight before rendering lit materials.For interactive apps:
viewer.render().Treat the container as the stable application boundary:
container passed to createViewer(...), or on another element owned by the application.Use the lightest cleanup method that matches ownership and lifecycle:
freeGPU() when the goal is to release GPU memory while keeping the object instance logically reusable. The object may upload GPU resources again if it is rendered or updated later.freeAllGpuResourceOwned() when the object owns related GPU resources that should also be released. For example, geometry.freeAllGpuResourceOwned() releases the geometry GPU resource plus its attribute and index GPU resources; drawable.freeAllGpuResourceOwned() releases its materials, geometry, and drawable GPU resources.destroy() only when the object is permanently retired. Before calling destroy(), ensure the object is removed from the scene, no frame callback, async load, event listener, control, viewport, material, geometry, or app state will use it again, and it is not currently participating in a render/update pass.freeGPU() or freeAllGpuResourceOwned() for memory-pressure cleanup. Prefer destroy() for final teardown after references are severed.Splat directly. Use loader and utility APIs.destroy() on resources that shared objects, cached data, render callbacks, or pending async work may still reference.destroy() as the default GPU-memory cleanup method. Use freeGPU() for the object's own GPU state, or freeAllGpuResourceOwned() when owned child resources should also release GPU state.AFaffaan-m/ECC278k近 7 天新增 4,046 个 star
ANanthropics/skills181k近 7 天新增 1,119 个 star
SHShubhamsaboo/awesome-llm-apps141k近 7 天新增 808 个 star
HAharry0703/MoneyPrinterTurbo130k近 7 天新增 1,722 个 star
PApaperclipai/paperclip101k近 7 天新增 2,948 个 star