Message Boards Message Boards

0
|
3974 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Graphics3D and Tooltips

Posted 10 years ago
I've built a notebook that generates a 3D graphic of a supermarket interior. It reads things like the dimensions and locations of shelves from a SQL database.

The model employs Graphics3D to display the components, and seems to work fine. However, when modelling complex stores, it would be great to have tool tips, so a mouse-over a component explains, for example, what is normally stored on that shelf.

If I can understand correctly, I cannot achieve this with Graphics3D, as it doesn't support tool tips.

So: what's the best way forward to switch from a Graphics3D-driven solution, to some other function that will allow me tool tips? I accept I'll lose real-time cursor rotation of the model and so on, but right now, tool tips are more important to me in complex models.

Given that my components are stored in a database, I am hoping to minimize changes made to the under lying graphics primitives. 

Thanks in advance for any help.
POSTED BY: Brad Varey
4 Replies
Posted 10 years ago
Hello, again, Bianca (and any others)

I think I now understand why I originally thought Tooltip[] wouldn't work with Graphics3D[].

Although my model is working now, it doesn't work all the time. Specifically, it seems to get confused when objects overlap one another (but not always).

For example, as I am modelling a supermarket, there is a Polygon[] object which represents the floor, but which has no tool tip. Shelf objects (Cuboid[]) do have a Tooltip. So viewed from directly above (a bird's eye view), all the shelves overlap completely the floor. Tooltips rarely work in this situation.

If I tilt the whole plot to, say, 45 degree angles, shelves which sit at the very edge of the floor are drawn partly overlapping the floor, but their height allows the upper part of them to be completely clear of the floor. Their Tooltip works consistently for the part which does not overlap the floor, but not for the part which does.

If I tilt the whole plot so I am looking edge on (a "shopper's eye view", if you want), none of the shelves effectively overlap the floor, and Tooltip works consistently.

But this is not just a bug where overlap fails and non-overlap works. Some of my shelves which are well inside the walls of the store work okay, but only a certain distance from the origin of Graphics3D[]. Thereafter they fail completely.

I have included my notebook so you can see what happens. Please DON'T evaluate the notebook, as it will try to make a connection to my database and fail!

Every shelf has a tooltip (although most are just IDs, some are English). I should note that this is being developed under Wolfram Workbench.


Regards

Brad
Attachments:
POSTED BY: Brad Varey
Hi Brad,

you're welcome, and I'm happy to hear that the problem could be solved so fast. (That's never a waste of time.)

Good luck with your code!

Bianca
POSTED BY: Bianca Eifert
Posted 10 years ago
Hi Bianca

Thanks very much for this. I must admit I tried Tooltp[] before, couldn't get it to work, and assumed that it was incompatible with Graphics3D, because of the latter's ability to rotate and re-size.

But I have just tried your example, and it does indeed work.

So thank you very much for your help, and I am very sorry to have wasted your time!

Regards

Brad
POSTED BY: Brad Varey
Hi Brad,

could you please specify which problem you encounter with tool tips in Graphics3D? They work fine in general:
Graphics3D[{Tooltip[Sphere[{0, 0, 0}], "one sphere"],
  Tooltip[Sphere[{2, 0, 0}], "another sphere"]}]
One problem that may arise is that the tooltip has to be on an actual object, which means that you can't tag bits of free space with tool tip messages, but you'd need to insert some placeholder object first.

I hope this helps a bit.

Bianca
POSTED BY: Bianca Eifert
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract