Enhance the APS Viewer SDK scene with GPU-accelerated “pushpin” icons that occlude behind models and support millions of instances at 60 FPS, with optional interactive card popups.
- High Performance: Render 1,000,000+ icons at 60 FPS
- Multi-Icon Support: 4 (or more) different icon types via a single 'sprite sheet'
- GPU Accelerated: It uses PointCloud shader under the hood
- Two Usage Modes: "Icons only", or "Icons with info card"
Use this for simple markup visualization without interactive info cards.
NOTE: You can remove the
icon3d.infoCard.jsfile
import { Icon3dToolExtension } from './ext/icon3d.js';
// Register extension
Autodesk.Viewing.theExtensionManager.registerExtension('icon3d', Icon3dToolExtension);
// Load in viewer config
const config = {
extensions: ['icon3d'],
extensionOptions: {
'icon3d': { dataSource: 'ext/icon3d.data.json' }
}
};
const viewer = new Autodesk.Viewing.GuiViewer3D(div, config);Use this for interactive icons with clickable info cards and 3D line connectors.
import { Icon3dExtension } from './ext/icon3d.infoCard.js';
// Register extension
Autodesk.Viewing.theExtensionManager.registerExtension('icon3d.infoCard', Icon3dExtension);
// Load in viewer config
const config = {
extensions: ['icon3d.infoCard'],
extensionOptions: {
'icon3d.infoCard': { dataSource: 'ext/icon3d.data.json' }
}
};
const viewer = new Autodesk.Viewing.GuiViewer3D(div, config);Create a JSON file with your markup data:
[
{
"id": 1,
"x": 10.5,
"y": 20.3,
"z": 5.8,
"icon": 0,
"title": "Issue #1",
"description": "Foundation crack detected",
"priority": "Critical",
"assignee": "John Doe",
"date": "2024-01-15"
}
]Icon Types:
0= Issue1= Warning2= RFI3= Hazard
Replace ext/icons.png with your own 4-icon sprite sheet (each icon 256x256px).
Edit ext/icon3d.js:
this.config = {
size: 150.0, // Icon size
threshold: 5 // Click hit radius
};Edit ext/icon3d.infoCard.js:
const LABEL_Z_OFFSET = 75; // 3D line height (Z-axis)
const LABEL_X_OFFSET = -90; // 2D label X offset in pixels
const LABEL_Y_OFFSET = -200; // 2D label Y offset in pixels
const LINE_COLOR = 0xffffff; // White line colorThe info card UI uses Tailwind CSS and can be customized in the createCardHTML() method.
Multi-Icon Rendering (Fragment Shader):
gl_FragColor = gl_FragColor * texture2D(tex,
vec2((gl_PointCoord.x + vColor.y * 1.0) / 4.0, 1.0 - gl_PointCoord.y)
);Distance-Based Scaling (Vertex Shader):
gl_PointSize = size * (size / (length(mvPosition.xyz) + 1.0));MIT License Copyright (c) 2025
