Observed since 20 Oct, 19:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
3d-qml-raub
QML 2D graphics plugin for Node.js 3D Core
This is a part of Node3D project.
npm i -s 3d-qml-raub
QML-rendering helpers for Node.js 3D Core. The QML backend is Qt 6.8.0.

Note: IMPORTANT, QML has its own OpenGL context. Make sure to switch back. Use
document.makeCurrent()orrelease()(see exported below).
import * as three from 'three';
import { init, addThreeHelpers } from '3d-core-raub';
import { init as initQml } from '3d-qml-raub';
// Standard Node3D init
const {
doc, Image: Img, gl,
} = init({
isGles3: true, isWebGL2: true, autoEsc: true,
});
addThreeHelpers(three, gl);
// Initialize QML and fetch the helpers
const {
QmlOverlay, Property, Method, View, loop, release, textureFromId,
} = initQml({
doc, gl, cwd: __dirname, three,
});
It is also possible to run QtQuick examples
on Node.js with this renderer. But it will only work with QtQuick components, i.e.
not QtMultimedia, QtNetwork, etc. - because those libs are not included.
See Dashboard
example being copied as a proof of concept.
A common use-case is full-screen overlay UI:
// Loads QML and creates all threejs-related resources, e.g. `overlay.mesh` is `THREE.Mesh`
const overlay = new QmlOverlay({ file: `${__dirname}/qml/Test.qml` });
scene.add(overlay.mesh);
// QML property access shortcut
const propTest = new Property<string>({
view: overlay, name: 'hud', key: 'testProp',
});
// A typed callable example
type TMethodTest = (arg0: number) => void;
const methodTest: TMethodTest = new Method({
view: overlay, name: 'hud', key: 'testMethod',
});
// Listen to a user-defined event (could be any other name)
overlay.on('custom-event', (event) => {
release();
if (event.button === 'test') {
console.log('test');
}
if (event.button === 'quit') {
process.exit(0)
}
});
propTest.value = 'test';
methodTest(123);
See examples for more details.
Creating a threejs Texture from QML View is also supported.
Such textures may be used in arbitrary threejs materials of your choise.
const testView = new View({ file: `${__dirname}/qml/Test.qml` });
const materialTest = new three.SpriteMaterial();
// If the view already has some texture - use it
materialTest.map = textureFromId(testView.textureId, renderer);
// If the view creates a new texture - update the material
testView.on('reset', (textureId) => {
release();
materialTest.map = textureFromId(textureId, renderer);
});
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
qml-raubEnvironment{
"local_name": "qml-raub",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | runtime |
threeEnvironment{
"local_name": "three",
"alias": false,
"peer_metadata": null
} | 0.172.0 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^9.17.0 | development |
@eslint/jsEnvironment{
"local_name": "@eslint/js",
"alias": false,
"peer_metadata": null
} | ^9.17.0 | development |
pixelmatchEnvironment{
"local_name": "pixelmatch",
"alias": false,
"peer_metadata": null
} | ^6.0.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.7.2 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^22.10.5 | development |
3d-core-raubEnvironment{
"local_name": "3d-core-raub",
"alias": false,
"peer_metadata": null
} | ^5.1.0 | development |
@types/threeEnvironment{
"local_name": "@types/three",
"alias": false,
"peer_metadata": null
} | 0.172.0 | development |
Source distribution
{
"shasum": "69b5b03e12ae0172475069e3cec02f02c177653e",
"tarball": "https://registry.npmjs.org/3d-qml-raub/-/3d-qml-raub-4.0.0.tgz",
"fileCount": 9,
"integrity": "sha512-9Gn3VPCx2M0SMEvdJ9sHKWLEADzpcrPUBjh5Ed0Ed5Cy7LVWP9iHMTDPUfypHVPjtpaQc9KYcUS5Toq+MzXDfg==",
"signatures": [
{
"sig": "MEUCIFUvwfSqTiR1IV7BoOCbP18fqe2DZMkvxDfIrRjqTIp7AiEAlMMOR2/vasX+m1PSEQDdTk53n5Qobu/TZiOC7emYLa8=",
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
}
],
"unpackedSize": 14562
}Observed since 20 Oct, 19:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:407b4b75cbd202bb446d1ed0e643e453631fa44b07c2e15c3a91a4ae899603de