Print at Dec 16, 2025, 2:27:00 PM
Posted by industria at Sep 22, 2016, 3:01:38 PM
Export HTML5 plug-in
How to click in a furniture (door, window etc) and open a Javascript alert contaign the CatalogID of the furniture clicked?

Posted by Puybaret at Sep 22, 2016, 4:04:27 PM
Re: Export HTML5 plug-in
You should call the method getClosestItemAt available in HomeComponent3D class in a listener added to the displayed canvas. If the returned object is an instance of HomePieceOfFurniture, then you may call its getCatalogId method to get its catalog ID and do whatever you want.
The HomeComponent3D instance is returned by the getComponent3D method available on the object returned by viewHome function.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Nov 21, 2018, 6:04:34 PM
Re: Export HTML5 plug-in
Please check my code. Why It not working well ?

Initialisation:

var HPC = viewHome("viewerCanvas", (... etc...));

//and the main function:
viewerCanvas.addEventListener("mouseup", function (e) {
console.log(e);
var rect = viewerCanvas.getBoundingClientRect();
var x = e.clientX; // - rect.left;
var y = e.clientY; // - rect.top;
console.log('mouse:' + x + ', ' + y);
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
console.log(obj);

});


And console has this after click on the furniture (i have only one):

mouseup { target: canvas#viewerCanvas.viewerComponent
, buttons: 0, clientX: 390, clientY: 233, layerX: 390, layerY: 233 }
viewHome.html:114:8
mouse:390, 233 viewHome.html:118:8
null

always is NULL! Can somebody explain why ? What do i wrong ?

Posted by boe666 at Nov 28, 2018, 8:32:53 AM
Re: Export HTML5 plug-in
Can anyone help ?

Posted by boe666 at Nov 28, 2018, 1:28:57 PM
Re: Export HTML5 plug-in
You should call the method getClosestItemAt available in HomeComponent3D class in a listener added to the displayed canvas. If the returned object is an instance of HomePieceOfFurniture, then you may call its getCatalogId method to get its catalog ID and do whatever you want.
The HomeComponent3D instance is returned by the getComponent3D method available on the object returned by viewHome function.


I tried to do it according this post but it is not working at all. I have access to Object'd list, to every variables and function, i studdy the JS API but i can't select any items my mouse, even set getHome().setSelectedItems(["number"]) do nothing (camera not move). I have set setAerialViewCenteredOnSelectionEnabled(true).

Can somebody help me to understand what do I wrong ?

Posted by Puybaret at Nov 28, 2018, 6:42:55 PM
Re: Export HTML5 plug-in
It's difficult to say without a real example. Can't you share a sample page?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Nov 29, 2018, 9:35:24 AM
Re: Export HTML5 plug-in
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>View home with Sweet Home 3D HTML5 Viewer</title>

<!-- Copy the following scripts in your page header -->
<script type="text/javascript" src="lib/big.min.js"></script>
<script type="text/javascript" src="lib/gl-matrix-min.js"></script>
<script type="text/javascript" src="lib/jszip.min.js"></script>
<script type="text/javascript" src="lib/core.min.js"></script>
<script type="text/javascript" src="lib/geom.min.js"></script>
<script type="text/javascript" src="lib/stroke.min.js"></script>
<script type="text/javascript" src="lib/batik-svgpathparser.min.js"></script>
<script type="text/javascript" src="lib/jsXmlSaxParser.min.js"></script>
<script type="text/javascript" src="lib/triangulator.min.js"></script>
<script type="text/javascript" src="lib/viewmodel.min.js"></script>
<script type="text/javascript" src="lib/viewhome.min.js"></script>

<style type="text/css">
/* The class of components handled by the viewer */
.viewerComponent {
}
</style>
</head>

<body>
<div>
<!-- Copy the following canvas and components in your page, changing their size / texts and other values if needed -->
<canvas id="viewerCanvas" class="viewerComponent" width="800" height="600"
style="background-color: #CCCCCC; border: 1px solid gray; outline:none" tabIndex="1"></canvas>
<div id="viewerProgressDiv" style="width: 400px; position: relative; top: -350px; left: 200px; background-color: rgba(128, 128, 128, 0.7); padding: 20px; border-radius: 25px">
<progress id="viewerProgress" class="viewerComponent" value="0" max="200" style="width: 400px"></progress>
<label id="viewerProgressLabel" class="viewerComponent" style="margin-top: 2px; display: block; margin-left: 10px"></label>
</div>
<div style="margin-top: -60px">
<input id="aerialView" class="viewerComponent" name="cameraType" type="radio" style="visibility: hidden;"/>
<label class="viewerComponent" for="aerialView" style="visibility: hidden;">Aerial view</label>
<input id="virtualVisit" class="viewerComponent" name="cameraType" type="radio" style="visibility: hidden;"/>
<label class="viewerComponent" for="virtualVisit" style="visibility: hidden;">Virtual visit</label>
<select id="levelsAndCameras" class="viewerComponent" style="visibility: hidden;"></select>
</div>
</div>
<div style="position: absolute; bottom: 5px; text-align: center; width: 95%; z-index: -1">
<a href="http://www.sweethome3d.com">Sweet Home 3D</a> HTML5 Viewer / Version 1.4 - Distributed under GNU General Public License
</div>

<!-- Copy the following script to view your home in the previous canvas -->
<script type="text/javascript">
var homeUrl = "test.zip";
var onerror = function(err) {
if (err == "No WebGL") {
alert("Sorry, your browser doesn't support WebGL.");
} else {
console.log(err.stack);
alert("Error: " + (err.message ? err.constructor.name + " " + err.message : err));
}
};
var onprogression = function(part, info, percentage) {
var progress = document.getElementById("viewerProgress");
if (part === HomeRecorder.READING_HOME) {
// Home loading is finished
progress.value = percentage * 100;
info = info.substring(info.lastIndexOf('/') + 1);
} else if (part === Node3D.READING_MODEL) {
// Models loading is finished
progress.value = 100 + percentage * 100;
if (percentage === 1) {
document.getElementById("viewerProgressDiv").style.visibility = "hidden";

//All is loaded at this point.
//Overall Listener
HPC.getHome().addFurnitureListener(function (e) {
console.log(e);
});
//set the parameter.
var UP = HPC.getUserPreferences();
UP.setAerialViewCenteredOnSelectionEnabled(true);
// check the value of parameter (to be sure)
var UP = HPC.getUserPreferences();
console.log(UP.isAerialViewCenteredOnSelectionEnabled() );
//list all Items.
var HOME = HPC.getHome();
var items = HOME.getSelectableViewableItems();
console.log(items);


//listener for mouse
viewerCanvas.addEventListener("mouseup", function (e) {
console.log(e);
var rect = HPC.getBoundingClientRect;
var x = e.clientX ;//- e.layerX;
var y = e.clientY ;//- e.layerY;
//log the x and y
console.log('mouse:' + x + ', ' + y );

//log the camera position x,y,z
var obj = HPC.getComponent3D();
console.log(obj);
var x1 = obj.camera.x;
var y1 = obj.camera.y;
var z1 = obj.camera.z;
console.log('camera:');
console.log('obj: x:'+x1+',y:'+y1+', z:'+z1);

//chceck item closest
var obj = HPC.getComponent3D().getClosestItemAt(x,y);
console.log(obj);
// ALWAYS NULL
var obj = HPC.getHome().getSelectableViewableItems();
//list of selectable items.
console.log(obj);
//select item nr 5 - nothing happend.
HPC.getHome().setSelectedItems(["5"]);

//check selected items
var obj = HPC.getHome().getSelectedItems();
console.log(obj)



});

}
}

document.getElementById("viewerProgressLabel").innerHTML =
(percentage ? Math.floor(percentage * 100) + "% " : "") + part + " " + info;
};

/
var HPC = viewHome("viewerCanvas", // Id of the canvas
homeUrl, // URL or relative URL of the home to display
onerror, // Callback called in case of error
onprogression, // Callback called while loading
{roundsPerMinute: 0, // Rotation speed of the animation launched once home is loaded in rounds per minute, no animation if missing or equal to 0
navigationPanel: "none", // Displayed navigation arrows, "none" or "default" for default one or an HTML string containing elements with data-simulated-key
// attribute set "UP", "DOWN", "LEFT", "RIGHT"... to replace the default navigation panel, "none" if missing
aerialViewButtonId: "aerialView", // Id of the aerial view radio button, radio buttons hidden if missing
virtualVisitButtonId: "virtualVisit", // Id of the aerial view radio button, radio buttons hidden if missing
levelsAndCamerasListId: "levelsAndCameras", // Id of the levels and cameras select component, hidden if missing
/* level: "Roof", */ // Uncomment to select the displayed level, default level if missing */
/* selectableLevels: ["Ground floor", "Roof"], */ // Uncomment to choose the list of displayed levels, no select component if empty array */
/* camera: "Exterior view", */ // Uncomment to select a camera, default camera if missing */
/* selectableCameras: ["Exterior view", "Kitchen"], */ // Uncomment to choose the list of displayed cameras, no camera if missing */
activateCameraSwitchKey: true // Switch between top view / virtual visit with space bar if not false or missing */
});
</script>

</body>
</html>


Posted by boe666 at Dec 3, 2018, 8:32:24 AM
Re: Export HTML5 plug-in
my real example is ok or somebody see there errors. What do I wrong ?

Posted by boe666 at Dec 3, 2018, 1:44:47 PM
Re: Export HTML5 plug-in
My changed code:
var HPC = viewHome("viewerCanvas",
homeUrl,
onerror,
onprogression,
{roundsPerMinute: 0,
navigationPanel: "none",
aerialViewButtonId: "aerialView",
virtualVisitButtonId: "virtualVisit",
levelsAndCamerasListId: "levelsAndCameras",
activateCameraSwitchKey: true
});




function myfunction() {
var UP = HPC.getUserPreferences();
var HOME = HPC.getHome();
var items = HOME.getSelectableViewableItems();
console.log(items);
UP.setAerialViewCenteredOnSelectionEnabled(true);
var itemSel = [items[89]];
HOME.setSelectedItems(itemSel);
//ITS WORKING!


viewerCanvas.addEventListener("mouseup", function (e) {
//console.log(e);
var rect = HPC.getBoundingClientRect;
var x = e.clientX ;//- e.layerX;
var y = e.clientY ;//- e.layerY;
//log the x and y
console.log('mouse:' + x + ', ' + y );
//chceck item closest
console.log("Zaznaczono objekt:")
var obj = HPC.getComponent3D().getClosestItemAt(x,y);
console.log(obj);
// NOT WORKING, ALWAYS NULL

});
}
</script>

I can select item by "finger" (in code), but still i can;t do it by mouse. Please help.

Posted by boe666 at Dec 5, 2018, 10:43:28 AM
Re: Export HTML5 plug-in
Can sombody Help ? I check the source. Method getClosestItemAt use the canvas3D.getClosestShapeAt. I don't know why it is't working - this object (HPC) has all furniture, selectable from code.

Posted by dorin at Dec 5, 2018, 6:46:31 PM
Re: Export HTML5 plug-in
I'am not sure but could be a problem of browser rather than coding.
Look at this answer
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law

Posted by Puybaret at Dec 5, 2018, 8:51:56 PM
Re: Export HTML5 plug-in
Thanks for trying to help Dorin, but your link points to problems in the Online version, not with the HTML5 viewer version.
Anyway, you're not wrong when your speak about browsers, because the viewer could also not work correctly on some browsers (even if I don't hope so).

boe666, the most helpful code is the one tested on a real web server with a real SH3D file. So please, upload your failing HTML5 code on a public web server with a SH3D file.
You could also use the very good JavaScript debuggers available in all modern browsers, and find what's wrong by yourself.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Dec 6, 2018, 9:28:20 AM
Re: Export HTML5 plug-in
ok. So I clean the code, and put all on this link:
http://smarted.pl/sh3d/viewHome.html#
As You can see - all object are selectable by code.
But not by the mouse.
Please check console.

Code below:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>View home with Sweet Home 3D HTML5 Viewer</title>

<!-- Copy the following scripts in your page header -->
<script type="text/javascript" src="lib/big.min.js"></script>
<script type="text/javascript" src="lib/gl-matrix-min.js"></script>
<script type="text/javascript" src="lib/jszip.min.js"></script>
<script type="text/javascript" src="lib/core.min.js"></script>
<script type="text/javascript" src="lib/geom.min.js"></script>
<script type="text/javascript" src="lib/stroke.min.js"></script>
<script type="text/javascript" src="lib/batik-svgpathparser.min.js"></script>
<script type="text/javascript" src="lib/jsXmlSaxParser.min.js"></script>
<script type="text/javascript" src="lib/triangulator.min.js"></script>
<script type="text/javascript" src="lib/viewmodel.min.js"></script>
<script type="text/javascript" src="lib/viewhome.min.js"></script>

<style type="text/css">
/* The class of components handled by the viewer */
.viewerComponent {
}
</style>
</head>

<body>
<div>
<!-- Copy the following canvas and components in your page, changing their size / texts and other values if needed -->
<table><tr><td style="margin-top:0px;">
<canvas id="viewerCanvas" class="viewerComponent" width="800" height="600"
style="background-color: #CCCCCC; border: 1px solid gray; outline:none" tabIndex="1"></canvas>
<div id="viewerProgressDiv" style="width: 400px; position: relative; top: -350px; left: 200px; background-color: rgba(128, 128, 128, 0.7); padding: 20px; border-radius: 25px">
<progress id="viewerProgress" class="viewerComponent" value="0" max="200" style="width: 400px"></progress>
<label id="viewerProgressLabel" class="viewerComponent" style="margin-top: 2px; display: block; margin-left: 10px"></label>
</div>
<div style="margin-top: -60px">
<input id="aerialView" class="viewerComponent" name="cameraType" type="radio" style="visibility: hidden;"/>
<label class="viewerComponent" for="aerialView" style="visibility: hidden;">Aerial view</label>
<input id="virtualVisit" class="viewerComponent" name="cameraType" type="radio" style="visibility: hidden;"/>
<label class="viewerComponent" for="virtualVisit" style="visibility: hidden;">Virtual visit</label>
<select id="levelsAndCameras" class="viewerComponent" style="visibility: hidden;"></select>
</div>
</div>
</td><td style="vertical-align:top;"><div id="PRitemlist" style="width:400px; margin-top:0px;></div>

</td></tr></table>
<div style="position: absolute; bottom: 5px; text-align: center; width: 95%; z-index: -1">
<a href="http://www.sweethome3d.com">Sweet Home 3D</a> HTML5 Viewer / Version 1.4 - Distributed under GNU General Public License
</div>

<!-- Copy the following script to view your home in the previous canvas -->
<script type="text/javascript">
var homeUrl = "test.zip";
var onerror = function(err) {
if (err == "No WebGL") {
alert("Sorry, your browser doesn't support WebGL.");
} else {
console.log(err.stack);
alert("Error: " + (err.message ? err.constructor.name + " " + err.message : err));
}
};
var onprogression = function(part, info, percentage) {
var progress = document.getElementById("viewerProgress");
if (part === HomeRecorder.READING_HOME) {
// Home loading is finished
progress.value = percentage * 100;
info = info.substring(info.lastIndexOf('/') + 1);
} else if (part === Node3D.READING_MODEL) {
// Models loading is finished
progress.value = 100 + percentage * 100;
if (percentage === 1) {
document.getElementById("viewerProgressDiv").style.visibility = "hidden";
setTimeout(myfunction,1000);
}
}
document.getElementById("viewerProgressLabel").innerHTML =
(percentage ? Math.floor(percentage * 100) + "% " : "") + part + " " + info;
};

var canvas = document.getElementsByTagName('canvas')[0];


var HPC = viewHome(canvas.id,
homeUrl,
onerror,
onprogression,
{roundsPerMinute: 0,
navigationPanel: "none",
aerialViewButtonId: "aerialView",
virtualVisitButtonId: "virtualVisit",
levelsAndCamerasListId: "levelsAndCameras",
activateCameraSwitchKey: true
});



function selectI(a)
{
var HOME = HPC.getHome();
var FURNITURES = HOME.getFurniture();

var itemSel = [FURNITURES[a]];
HOME.setSelectedItems(itemSel);
console.log(itemSel);
console.log("Selected by Link: ID:" + a +", name:"+itemSel[0].name);
}
function myfunction() {
var UP = HPC.getUserPreferences();
UP.setAerialViewCenteredOnSelectionEnabled(true);
var HOME = HPC.getHome();
var FURNITURES = HOME.getFurniture();
var ITEMS = HOME.getSelectableViewableItems();
console.log("All items: ");
console.log(ITEMS);
console.log("All furnitures: ");
console.log(FURNITURES);


var tt = 'All FURNITURES:<br/>';
var i;
for (i = 0; i < FURNITURES.length; i++) {
tt += '<a href=\"#\" style=\"float:left;border:1px #000000 solid; padding:2px; margin:2px;\" onclick=\"selectI('+i+');\" >'+FURNITURES.name+'</a>';
}
document.getElementById("PRitemlist").innerHTML=tt;



canvas.addEventListener("mouseup", function (e) {
var rect = canvas.getBoundingClientRect;
var x = e.clientX ;//- e.layerX;
var y = e.clientY ;//- e.layerY;
console.log('mouse pointer:' + x + ', ' + y );
console.log("Finded objekt:");
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
console.log("Finded objekt:"+obj);

});
}
</script>

</body>
</html>



Posted by boe666 at Dec 10, 2018, 10:03:48 AM
Re: Export HTML5 plug-in
Can somebody help ?

Posted by boe666 at Dec 11, 2018, 8:02:47 AM
Re: Export HTML5 plug-in
Ok, so if nobody can help in this situation, maybe sombody can help - how to calculate z dimention and z,y depend of actual camera's position ? Where can I find proper values?

Posted by Puybaret at Dec 11, 2018, 10:16:41 AM
Re: Export HTML5 plug-in
I tried your program in Safari debugger and the object returned at the line
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
was "almost" found. By "almost", I mean that your x,y coordinates are wrong, and you should translate them in canvas space, removing rect.x and rect.y (but rect can't be correct because you forgot brackets at the end of canvas.getBoundingClientRect).

You should really learn how to use a JavaScript debugger.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Dec 11, 2018, 11:31:56 AM
Re: Export HTML5 plug-in
I understand my mistake, but can You show me how i can translate them in canvas space ? Maybe some links ?

Posted by boe666 at Dec 11, 2018, 12:45:08 PM
Re: Export HTML5 plug-in
I'm trying to understand this, i think it's depend on camera position (before i think the getClosestItemAt calculate this automaticaly) but without any examples i don't know how to start.

Posted by Puybaret at Dec 11, 2018, 1:04:07 PM
Re: Export HTML5 plug-in
I wrote you how to fix your issue.
Sorry, I can't help you more, it's really basic JavaScript.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Dec 11, 2018, 1:24:46 PM
Re: Export HTML5 plug-in
so, if I understand this proper. I have to translate x,y coordinates (given from flat rectangle) to coordinates in the actual perspective of my model's floor. After this, method getClosestItemAt fill return objects.
Am I Correct ?

Posted by boe666 at Dec 11, 2018, 2:35:58 PM
Re: Export HTML5 plug-in
Can I check this getClosestItemAt method ? Where is object's coordinates ? If I write x an y direct in code - this method still return null. I take x y coordinates from js console after selected object by code. i.e.:
selecting object:

HOME.setSelectedItems(itemSel);
console.log(itemSel);

and I take x y from itemSel[0].x and itemSel[0].y
I write this to my listener (from now always return this coordinates), and still i have null after use getClosestItemAt(x,y).

I thought i have to translate x,y from mouse, to have always the same coordinates, independed from actual view of camera, coresponding with object's x and y.

Posted by boe666 at Dec 11, 2018, 3:00:19 PM
Re: Export HTML5 plug-in
Or maybe this is the problem. Shown after click on canvas.

Error: WebGL warning: drawArrays: Feedback loop detected between tex target 0x0de1, tex unit 0, levels 0-0; and framebuffer attachment 0x8ce0, level 0.
viewmodel.min.js:20:53017
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings) viewmodel.min.js:20:53017


Posted by Puybaret at Dec 11, 2018, 4:00:59 PM
Re: Export HTML5 plug-in
The problem is that you read too quickly the setSelectedItems jsdoc sad
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Dec 11, 2018, 5:13:27 PM
Re: Export HTML5 plug-in
I don't understand. First of all I read all furnitures to table (FURNITURES[]). After this i print the links to select every funriture ( from this table). After click i do this:

var HOME = HPC.getHome();
var FURNITURES = HOME.getFurniture();

var itemSel = [FURNITURES[a]];
HOME.setSelectedItems(itemSel);
console.log(itemSel);
console.log("Selected by Link: ID:" + a +", name:"+itemSel[0].x);
var itemSel2 = HOME.getSelectedItems();
console.log("Read selected:" + a +", name:"+itemSel2[0].x);

every furniture has his own x and y coordinates. In console I have all object (with many data) in room (every furniture) after console.log(FURNITURES);
This is not problem with to fast reading.
How can I read proper x and y for one furniture ? (to check getClosestItemsAt)

Posted by boe666 at Dec 12, 2018, 8:17:16 AM
Re: Export HTML5 plug-in
Maybe my questions are stupid and for many of You - "groundless", but I realy want understand structure of sweethome3d (in HTML5). Most (in my opinion - almost all) posts on this forum concerns on java version and problems with aplication ( directly on "painting" models). Can you show me the way to do this ? For example - if I confirm what x,y coordinates work with getClosestItemsAt, I will find the way how to calculate x,y depend of actual camera view. I want to eliminate errors before I started, I want to be sure I'm not making a simple mistake.

Posted by Puybaret at Dec 12, 2018, 6:16:00 PM
Re: Export HTML5 plug-in
Your questions are not stupid, but most contributors in the forum are Sweet Home 3D users, not programmers (and even less JavaScript programmers). If you want to understand how to use Sweet Home 3D JS, learn how to use the debugger in your browser, this will help you in many cases.
By the way, getClosestItemsAt method takes in parameter 2D coordinates, so translating to canvas space just consist of substracting rect.x and rect.y from e.clientX and e.clientY. Measuring pixel locations at screen with your mouse pointer would have given you the solution...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by boe666 at Dec 12, 2018, 7:43:57 PM
Re: Export HTML5 plug-in
Before I ask and write more question - i checked this - it's not working. I thought i have to recalculate x,y from plain rec to virtual canvas (2d to 3d coordinates - x,y only of course). I was ready to check every x,y combination to check proper work getClosestItemsAt function.
I change my code, this part:

function getMousePos(canvas, evt) {
var rect = canvas.getBoundingClientRect();
console.log(rect);
var x1 = evt.clientX - rect.x;
var y1 = evt.clientY - rect.y;
return {
x: (x1),
y: (y1)
};
}



canvas.addEventListener("mouseup", function (e) {
var mousePos = getMousePos(canvas, e);
var x = mousePos.x;
var y = mousePos.y;
console.log('mousePos:'+x+','+y);
var cams = HOME.getCamera();
console.log(cams);
var obj = HPC.getComponent3D().getClosestItemAt(x, y);
console.log("Finded objekt:"+obj);

});

console after loading:
Error: WebGL warning: drawArrays: Drawing to a destination rect smaller than the viewport rect. (This warning will only be given once) viewmodel.min.js:20:53017
All items: viewHome.html:118:7
Array(98) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]
viewHome.html:119:4
All furnitures: viewHome.html:120:4
Array(80) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]
viewHome.html:121:4
WebGLRenderingContext { canvas: canvas#viewerCanvas.viewerComponent
, drawingBufferWidth: 800, drawingBufferHeight: 600 }
viewHome.html:133:3


console after click on canvas:

DOMRect { x: 11, y: 11, width: 802, height: 602, top: 11, right: 813, bottom: 613, left: 11 }
viewHome.html:137:3
mousePos:640,214 viewHome.html:152:3
Object { properties: null, name: null, x: 329.2859606627597, y: 529.2522494347633, z: 1276.0331000000006, yaw: 4.714197, pitch: 1.5707964, fieldOfView: 1.0995575, time: 1492084800000, lens: 0, … }
viewHome.html:154:3
Finded objekt:null viewHome.html:156:3
Error: WebGL warning: clear: This operation requires zeroing texture data. This is slow. viewmodel.min.js:20:55899
Error: WebGL warning: drawArrays: Texture level 0 would be read by TEXTURE_2D unit 0, but written by framebuffer attachment COLOR_ATTACHMENT0, which would be illegal feedback.
viewmodel.min.js:20:53017
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings) viewmodel.min.js:20:53017


make this errors problem?
code is ok ?
http://smarted.pl/sh3d/viewHome.html#

Posted by boe666 at Dec 15, 2018, 3:28:29 PM
Re: Export HTML5 plug-in
somebody can can check the code ? Now it's ok ? If ok, why it not working ? Maybe the errors are the problem ? Ho to eliminate this errors ?

Posted by boe666 at Dec 18, 2018, 9:48:14 AM
Re: Export HTML5 plug-in
Somebody ????

Posted by boe666 at Jan 3, 2019, 2:07:31 PM
Re: Export HTML5 plug-in
Maybe, in first days of new year, somebody show my indolence.. I realy don't know why .getClosestItemAt(x, y) doesn't work....

Posted by Puybaret at Jan 3, 2019, 4:24:38 PM
Re: Export HTML5 plug-in
Maybe try another browser, because it seems to work on my side. The console doesn't display null for the obj returned by getClosestItem.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator