Skip to content

i3ernie/three-domevents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0d5fdeb · Dec 16, 2024
Jan 6, 2024
Aug 19, 2020
Sep 29, 2023
Sep 29, 2023
Jan 13, 2024
Oct 1, 2023
Dec 16, 2024
Dec 16, 2024
Aug 19, 2020
Jul 22, 2020
Sep 28, 2023
Dec 1, 2021
Dec 16, 2024
Dec 16, 2024
Sep 26, 2023

Repository files navigation

three-domevents

DeepScan grade ...

JavaScript library for three.js

The aim of the project is to create an easy to use dom-event handling for three.js scene objects.

useage

easy-to-use

    DEH = new DomEvents( VP.camera, VP.renderer.domElement );

    let activeWorld = new THREE.Object3D();
    activeWorld.name = "active_world";
    VP.scene.add( activeWorld );


    let world = new THREE.Object3D();
    world.name = "world";
    VP.scene.add( world );

    DEH.activate( activeWorld ); //or for global: DEH.activate( VP.Scene )

    //add activeWorld child
    let mesh = new THREE.Mesh( new THREE.BoxGeomtry, new THREE.StandardMeshMaterial() );
    mesh.onClick = function(){
        alert("click");
    };

    VP.scene.add( mesh );

minimal config in one line this will activate the whole scene node and all added childs

    //activate scene graph
    new DomEvents( VP.camera, VP.renderer.domElement ).activate( VP.scene );

    //active scene child
    let mesh = new THREE.Mesh( new THREE.BoxGeomtry, new THREE.StandardMeshMaterial() );
    mesh.onClick = function(){
        alert("click");
    };

    VP.scene.add( mesh );

Examples

... example.

Support or Contact

..