blender-motion-state-inspection
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
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, and set it with viewer.setCamera(camera). Configure the rendering pipeline with setViewerConfig(viewer, { pipeline: ... }).
Load the assets and add their objects to viewer.getScene(). For splats that use autoFreeResourceOnGpuPacked, choose packing precision, SH precalculation, and camera-relative packing before loading. Changing these options later requires the source data again.
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);
camera.up.set(0, -1, 0);
camera.position.set(-1.5, -0.5, 0);
camera.lookAt(new Vector3(0, 0, 0));
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 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);
viewer.getScene().add(splat);
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(...) defaults to streaming and Morton order for decoded splats. Pass { mortonSort: false } when indices refer to file order, including in custom chunk LOD loaders.await SplatUtils.createSplat(data) collects CPU data automatically. To serialize or edit parsed data before creating the splat, pass { stream: false } during parsing or call await data.collect() first.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() to release GPU memory for an object whose source data the application can restore. CPU-backed splats can upload their samplers again. For a splat created by direct GPU upload, reparse the original asset after releasing its source textures.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/ECC315k4,381 new stars in the last 7 days
Generate flow fields and particle systems with p5.js, using seeded randomness for original algorithmic art.
ANanthropics/skills203k3,265 new stars in the last 7 days
ANanthropics/skills203k3,265 new stars in the last 7 days
HAharry0703/MoneyPrinterTurbo147k1,608 new stars in the last 7 days
SHShubhamsaboo/awesome-llm-apps147k907 new stars in the last 7 days
GAgarrytan/gstack143k598 new stars in the last 7 days