Some time ago, I promised to make an example about picking objects, based on the color of their geometry. And here it is .
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 .
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 !
Picking by geom color.zip (49.3 KB)