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 characters
| //RETURNS TRUE/FALSE BASED ON WHETHER OR NOT THE ENTITY IS VISIBLE | |
| checkIfVisible(entity, camera){ | |
| let entityMesh = entity.object3DMap.mesh; | |
| let frustum = new THREE.Frustum(); | |
| let cameraViewProjectionMatrix = new THREE.Matrix4(); | |
| camera.updateMatrixWorld(); | |
| camera.matrixWorldInverse.getInverse(camera.matrixWorld); | |
| cameraViewProjectionMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); |
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 characters
| /** | |
| * Get a list of the top selling products on a Drupal Commerce site | |
| * If you have different product types - add them to the in list. | |
| * Based on https://drupal.org/node/1292104#comment-6866420 by tmsimont https://drupal.org/user/566678 | |
| */ | |
| SELECT node.title AS product_title, node.nid AS product_nid, COUNT(cp.title) AS order_count | |
| FROM commerce_order | |
| LEFT JOIN field_data_commerce_line_items as fdcli ON commerce_order.order_id = fdcli.entity_id AND (fdcli.entity_type = 'commerce_order' AND fdcli.deleted = '0') | |
| INNER JOIN commerce_line_item as cli ON fdcli.commerce_line_items_line_item_id = cli.line_item_id |
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 characters
| <canvas id="myCanvas"> </canvas> | |
| <script> | |
| let img = new (window as any).Image(); | |
| img.crossOrigin = `Anonymous`; | |
| img.src = "https://images.unsplash.com/photo-1667461143891-d52ffd5500f5"; | |
| img.onload = function () { | |
| canvas = document.getElementById("myCanvas") as HTMLCanvasElement; |
OlderNewer