mosra / magnum-examples

Examples for the Magnum C++11 graphics engine
https://magnum.graphics/
The Unlicense
282 stars 95 forks source link

Add Primitives SceneGraph Examples #82

Open pomeroyb opened 4 years ago

pomeroyb commented 4 years ago

I've been meaning to get back into learning Magnum, and what better way than to learn than to help make some examples!

I saw that this was a desired sub project from https://github.com/mosra/magnum/issues/102

I added a bit more functionality than the python example had, to control both the drawables and the camera. It's landed somewhere between the primitives example, then python scenegraph, and the picking example.

Let me know if any changes need to be made 👍

pomeroyb commented 4 years ago

Thanks for the feedback! I've made almost all the changes you suggested. The only one that needs a bit more review is the rotation. Using rotateLocal() does work fine, but the delta.x() and delta.y() need to be reversed to see the correct rotation. I've included a video showing what I mean:

https://youtu.be/6fQTFLv8ceQ

I'm not sure if this is a convention in Magnum or if I'm doing something wrong... 🤷‍♀️

mosra commented 4 years ago

Hah, no, I clearly messed up in that suggestion, sorry. Will fix this during merge.

Thank you!

mosra commented 4 years ago

In case you're wondering why no merge happened yet -- I wanted to take the Viewer tutorial and split the scenegraph-related stuff into a tutorial this example, as it's easier to absorb it in two smaller pieces. So I need to do some writing first :)

pomeroyb commented 4 years ago

No worries at all! I'm writing examples to help myself learn Magnum in small steps -- being able to contribute them to the project is just a bonus. 👍