Now we can use the mouse to play around with the particles. The two objects, part_source
and part_orbitpoint
contain the specification of a point in three-dimensional space. For part_source
, it specifies the location where particles are emitted. For part_orbitpoint
, it indicates a point where other particles are attracted. For the mouse position, we use the gemmouse
object. Remember that it will give us two numbers, X and Y positions in a normalized scale between 0 and 1 as shown in the following screenshot:
We are using the dimension of 800 x 600 pixels. The GEM window measurement for the screen is around 10.66 x 8.0. The Y direction is reversed between the mouse measurement and the GEM graphics measurement. The computation after the gemmouse
object takes care of the unit conversion. The pack
object combines the three numbers into a list of positions in three-dimensional space for the part_source
object, as shown in the following screenshot:
You may find that all...