-
-
Save molotovbliss/d661b62e30ed0998c54f85ebbe397f78 to your computer and use it in GitHub Desktop.
Revisions
-
molotovbliss revised this gist
Feb 18, 2021 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,15 +7,16 @@ canvasPos: coords, pickSurface: true }); console.log("=================== DEBUG PICKED ======================="); if (hit) { var mesh = hit.mesh; console.log("Picked:"); console.log("hit.mesh.parent == " + JSON.stringify(mesh.parent.id)); console.log("hit.mesh._material._state == " + JSON.stringify(mesh._material._state)); console.log("hit.mesh == xeogl.scenes[" + mesh.scene.id + "].entities[" + mesh.id + "]"); console.log("hit.worldPos == [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); console.log("hit.bary == [" + hit.bary[0] + "," + hit.bary[1] + "," + hit.bary[2] + "]"); console.log("hit.primIndex == " + hit.primIndex); } else { console.log("Nothing picked."); } -
molotovbliss revised this gist
Feb 18, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ (function () { var scenes = window.xeogl.scenes; for (var sceneId in scenes) { if (scenes.hasOwnProperty(sceneId)) { scenes[sceneId].input.on("mouseclicked", function (coords) { -
molotovbliss revised this gist
Jan 14, 2021 . No changes.There are no files selected for viewing
-
xeolabs revised this gist
Oct 25, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,8 @@ console.log("hit.entity == xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "]"); console.log("hit.entity.meta == " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos == [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); console.log("hit.bary == [" + hit.bary[0] + "," + hit.bary[1] + "," + hit.bary[2] + "]"); console.log("hit.primIndex == " + hit.primIndex); } else { console.log("Nothing picked."); } -
xeolabs revised this gist
Nov 25, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ if (hit) { var entity = hit.entity; console.log("Picked:"); console.log("hit.entity == xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "]"); console.log("hit.entity.meta == " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos == [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); } else { -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ if (hit) { var entity = hit.entity; console.log("Picked:"); console.log("hit.entity == xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "]; console.log("hit.entity.meta == " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos == [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); } else { -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,9 @@ if (hit) { var entity = hit.entity; console.log("Picked:"); console.log("hit.entity == xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.entity.meta == " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos == [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); } else { console.log("Nothing picked."); } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ canvasPos: coords, pickSurface: true }); console.log(""); if (hit) { var entity = hit.entity; console.log("Picked:"); @@ -16,7 +16,7 @@ } else { console.log("Nothing picked."); } console.log(""); }); } } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ var entity = hit.entity; console.log("Picked:"); console.log("hit.entity = xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos = [" + hit.worldPos[0] + "," + hit.worldPos[1] + "," + hit.worldPos[2] + "]"); } else { console.log("Nothing picked."); } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ var entity = hit.entity; console.log("Picked:"); console.log("hit.entity = xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos = [" + hit.worldPos[0], hit.worldPos[1], hit.worldPos[2] + "]"); } else { console.log("Nothing picked."); } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,16 +4,15 @@ if (scenes.hasOwnProperty(sceneId)) { scenes[sceneId].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ // "this" points to the xeogl.Input component canvasPos: coords, pickSurface: true }); console.log("----------------------------------------------------------------------------------------------------"); if (hit) { var entity = hit.entity; console.log("Picked:"); console.log("hit.entity = xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); console.log("hit.worldPos = " + JSON.stringify(hit.worldPos, null, '\t')); } else { console.log("Nothing picked."); } -
xeolabs renamed this gist
Nov 24, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,18 @@ var hit = this.scene.pick({ // "this" points to the xeogl.Input component canvasPos: coords }); console.log("----------------------------------------------------------------------------------------------------"); if (hit) { var entity = hit.entity; console.log("Picked:"); console.log("hit.entity = xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); if (hit.worldPos) { console.log("hit.worldPos = " + JSON.stringify(hit.worldPos, null, '\t')); } } else { console.log("Nothing picked."); } console.log("----------------------------------------------------------------------------------------------------"); }); } } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 15 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,18 @@ (function () { var scenes = xeogl.scenes; for (var sceneId in scenes) { if (scenes.hasOwnProperty(sceneId)) { scenes[sceneId].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ // "this" points to the xeogl.Input component canvasPos: coords }); if (hit) { var entity = hit.entity; console.log("Picked xeogl.scenes[" + entity.scene.id + "].entities[" + entity.id + "].meta = " + JSON.stringify(entity.meta, null, '\t')); } else { console.log("Nothing picked."); } }); } } })(); -
xeolabs revised this gist
Nov 24, 2016 . No changes.There are no files selected for viewing
-
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ (function () { var mySceneID = 0; // <---- Change to your Scene ID, or leave untouched if using xeogl's default Scene xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ canvasPos: coords -
xeolabs renamed this gist
Nov 24, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 15 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,17 @@ (function () { var mySceneID = 0; // <---- Change to your Scene ID, or leave untouched if using xeogl's default Scene xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ canvasPos: coords }); if (hit) { var entity = hit.entity; this.log("Picked Entity '" + entity.id + "'"); this.log("Entity metadata:\n" + JSON.stringify(entity.meta, null, '\t')); } else { this.log("Nothing picked."); } }); })(); -
xeolabs revised this gist
Nov 24, 2016 . No changes.There are no files selected for viewing
-
xeolabs revised this gist
Nov 24, 2016 . No changes.There are no files selected for viewing
-
xeolabs revised this gist
Nov 24, 2016 . No changes.There are no files selected for viewing
-
xeolabs renamed this gist
Nov 24, 2016 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ // Console snippet to let you click on an Entity to get info on it. // Set mySceneID to your Scene's ID, or leave as is to work with xeogl's default Scene. var mySceneID = 0; xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ canvasPos: coords }); if (hit) { var entity = hit.entity; this.log("Picked Entity '" + entity.id + "'"); this.log("Metadata:\n" + JSON.stringify(entity.meta, null, '\t')); } else { this.log("Nothing picked."); } -
xeolabs revised this gist
Nov 24, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,10 +2,8 @@ // Set mySceneID to your Scene's ID, or leave as is to work with xeogl's default Scene. var mySceneID = 0; xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) { var hit = this.scene.pick({ canvasPos: coords }); if (hit) { -
xeolabs created this gist
Nov 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // Console snippet to let you click on an Entity to get it's ID // Set mySceneID to your Scene's ID, or leave as is to work with xeogl's default Scene. var mySceneID = 0; xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) { var hit = scene.pick({ canvasPos: coords }); if (hit) { this.log("Picked Entity '" + hit.entity.id + "'"); } else { this.log("Nothing picked."); } });