Article Preview
Buy Now
FEATURE
Rotating Christmas Tree
Using the MBS Plugins to create an animated 3D Christmas tree
Issue: 19.6 (November/December 2021)
Author: Stefanie Juchmes
Author Bio: Stefanie studied computer science at the university in Bonn. She came in touch with Xojo due to the work of her brother-in-law and got a junior developer position in early 2019 at Monkeybread Software.
Article Description: No description available.
Article Length (in bytes): 11,724
Starting Page Number: 45
Article Number: 19606
Resource File(s):
project19606.zip Updated: 2021-10-31 22:33:26
Related Link(s): None
Excerpt of article text...
It's Christmas time! This time I want to show you how you can animate your own turn-around Christmas tree in Xojo. We then also want to decorate the tree.
We will use the functions from the MBS Xojo SceneKit Plugin. Before we start, first we need to think about what our tree should look like. For the sake of simplicity, we will limit this example to the basic SceneKit figures from which we want to build the tree. We have spheres, plates, boxes, truncated cones, capsules, cylinders, tubes, and pyramids to build the tree from (see Figure 1).
The tree is made of fir greenery and a trunk. The trunk is simply a cylinder. On top of it we have two truncated cones and a whole cone on top. On the tree hang Christmas baubles (spheres) and on the top is a star consisting of a sphere and six pyramids that form the prongs of the star.
Before we can see anything in our project we have to position the
SCNControlMBS
on our window. We then additionally create the propertiesMyScene as SCNSceneMBS
andMyView as SCNViewMBS
. We write our code in theOpen
event of the control. There we first assign the values to the properties:
MyView = Me.View
...End of Excerpt. Please purchase the magazine to read the full article.