Page 1 of 1

Finding object in 3D view

Posted: Fri Aug 02, 2024 2:10 am
by Russell 22
Hello

I have a tree view in my application, similar to model explorer, which shows the entities. I would like to highlight the object in 3D view when it is selected in the tree view.

I need a bit of help with that.
Thank you

Re: Finding object in 3D view

Posted: Sun Aug 04, 2024 3:25 am
by Prashant Kande
Hello Russel

This can also be done using Model Explore and DGK's Misc event like demoes in eMotion sample.

It seems that you prefer your own implementation. You are creating a tree view node per entity, right? I suggest that you store reference to IEntity_DG in the node. I think it has Tag property for that, otherwise just use an appropriate map.

In a handler of your tree view selection, you need to add/update the list of selected entities as the current entity list:
dgk.GetView() > IView_DG > GetScene() > IScene_DG > GetCurrentItemSet() > ISelection_DG.
And use ISelection_DG.ClearSelection(), SetSelected(entity as IObject_DG, true).

This will mix is a red component into the entity's color during presentation.

You can also implement your own way of highlighting the selection either using colors or may be something like adding a wireframe box around the object

Regards