roland
August 29, 2023, 3:45am
5
Would you please provide a PG next time you asking a question? It’ll help to avoid misunderstanding of your problem.
So if your GUI is on a plane the control coordinates are relative to that plane so you just need to add screen cordinates of that plane to the coordinates of the control. You won’t need that funky piece of code at all.
getClientRect function source:
Hi!
I’m doing a mashup where I have a BJS scene and now I want to overlay a popper.js tooltip when I hover over some meshes.
for popper.js to be able to know where to position itself you need to pass in a referenceObject.
import { ReferenceObject } from 'popper.js'
const ref: ReferenceObject = {
clientHeight: 1000, // screen width
clientWidth: 500, // screen height
getBoundingClientRect() {
return {
width: 400, // the meshes boundingbox width
…
extent source:
export default function extent(values, valueof) {
let min;
let max;
if (valueof === undefined) {
for (const value of values) {
if (value != null) {
if (min === undefined) {
if (value >= value) min = max = value;
} else {
if (min > value) min = value;
if (max < value) max = value;
}
}
}
} else {
let index = -1;
for (let value of values) {
if ((value = valueof(value, ++index, values)) != null) {
if (min === undefined) {
if (value >= value) min = max = value;
This file has been truncated. show original