Popup text box on clickable 3d object - help please

I’m getting it :slight_smile: I added a third text box on this model for the building in the background :slight_smile: https://playground.babylonjs.com/#9Z476P#9

Strange that you can click individual buildings here and the text comes up for each building but it doesn’t work the same with with highlighting.

So for the 500 odd buildings I have in my main one, would I need to re-create the logic in the playground I have there all the way to text.500? :open_mouth:

I’ll be back in the morning by the way (UK time) thanks for your help so far. Looking forward to getting stuck in again

I’ve made progress! Dropbox - index11.html - Simplify your life

Stripped out the site’s html as best as I could and managed to get the popup showing! Just need to figure out why I can’t close the boxes now. Does this always load a page from a website? Is there a way to have a plain text input with shortcodes [postid=18] [pluginxyzexample]?

You can use in modals any content you need.
In my case this is iframe with some linked post.

Where there is a will there a way :slight_smile:
The solution will depend on what do you get from your shortcode - HTML page or just some text content.

I think I’ll prepare more simple example (with working Close button) later during the day.

That’s very kind of you. Happy new year by the way :blush:

It would be the shortcode, pulling text from a post page and another short code also pulling in information.

Thanks, it seems that New Year really came to us, finally :slight_smile:

Here is the simplest example, heavily commented and consoled -
https://igiuk.com/3d-utilities/modals/

The matter is that you cannot just paste a Wordpress shortcode to JS - there should be some JS functions created which will transform your WP IDs into HTML.

Amazing, that’s just what I need! Thank you, time to see if I can integrate this into my model and my site :slight_smile:

1 Like

I’ve got it working as I need but I wonder if I’ll have the same issue as the highlight layer, where I can only use the mesh as the layer to select rather than the object name. It seemed to only like the mesh names when I tried which would be a show stopper.

It would mean that different buildings with the same mesh would bring the same info up.

The thing is that if it is all instances of a mesh would be highlighted when you highlight this mesh.
Yo may need additional trick, basically the same as with highlight layer (substitute an instance with a clone).

You can use transform node name as identifier for instance.

I need to look into this a bit more I think. Trying to get it to work for https://playground.babylonjs.com/#9Z476P#9 this basic model. I have 500 buildings and 50 or so are all duplicate buildings with the same mesh so there’s a lot of duplicates. If this would work that would be perfect. I’m not 100% sure how to implement it as there aren’t too many examples of this use that I’ve found on my first search.

I think I’ll make a simple example later today.

Thanks again :slight_smile:

Meanwhile you may have a look at thin intances too - Thinnizator - automatic thin instances

1 Like

I like the idea, I’ve tried to implement some of the code here but it’s not working (due to my lack of knowledge/coding skills ha). https://playground.babylonjs.com/#9Z476P#10

I definitely need some performance improvement on my main model as it’s running around 4-6 fps atm.

Do you really need to show all 500 buildings at once?

The scene isn’t too big. I had thought about incremental loading with a closer camera but in the end I decided that it would be better if all the buildings where in view.

To make things more complicated I have some objects with one material and some with two.
snipping