Picking by geom color, transform gizmos and more

Some time ago, I promised to make an example about picking objects, based on the color of their geometry. And here it is :slight_smile: .

Since I did not want the example to be about picking objects only, but also about transforming those objects using gizmos (which also need to be pickable), it was hard to avoid creating a quite advanced example. Ultimately, I ended up with a simplified version of my personal project in its current state.
And although it may look like yet another level editor, it is not - we already have that particular one :wink: .

But if you’re only interested in how the picking works, don’t worry, a very basic example of this is included also.

The attached .zip file contains:

  • a basic example that shows how to highlight procedurally generated cubes;

  • an advanced example, featuring:
    [list][*]interactive creation of primitives (boxes and spheres);

  • gizmos to interactively transform selected primitives;

  • detection of gizmos, primitives and their bounding boxes;

  • the use of managers and states to make working with a large project easier;

  • context-sensitive onscreen information (the “GUI”).

If you need more info, see the included Readme’s for some walls of text.

There is no license; feel free to mess about with the code however you wish.
All I ask is that you give me some credit if you decide to abuse my code in your own projects.

And on that note I would like to thank kurohyou for inspiring me to create this example, and coppertop for his nice compact int-to-VBase4 color conversion code.

Have fun :slight_smile: !
Picking by geom color.zip (49.3 KB)

This is really top notch stuff. Feels just like I’m using 3ds Max again :slight_smile: I hope you don’t mind if I liberate some of this code and integrate it into my own editors and gizmos - the interactive primitive generation is great also!

Congratulations, and thanks for sharing!

Glad to hear you like it :slight_smile: !

Of course; you can use as much of the code as you want in your own work - that was the whole point, after all :wink: .