Geometric primitives

  • Point
  • Plane
  • Cube
  • Sphere
  • Cone
  • Pyramid
  • Cylinder
  • Hexagon
../../_images/image-157.png

Geometric primitives have the following behaviors:

What is a point - mathematical point or empty object is invisible in view mode. Can be used as a parent object for easy work with hierarchy. It’s also convenient to set path when navigating a route by creating a list of points and passing it as a route

Note

For every geometric object, except the point, you can set visualization parameters, more details about which you can read in the related article

Example

Consider an example of using primitives to create a route to move from object to object, i.e. by route

  1. Place on the 3D scene several of any objects that are in your object library

Note

Important, only Varwin objects are suitable for setting a route!

In our example, place a cube, a cylinder, a pyramid, a hexagon, a sphere, and a point

../../_images/image-235.png
  1. Save the scene and go to the logic editor. Let’s create a simple logic like this:
../../_images/image-331.png

2.1 Let’s mark the block “Start the chain when the scene starts” from the category “Events” to initialize events when the scene starts

2.2. Create a variable “Route” in the category “Variables”

2.3. Assign the created variable to create a list, block “Create a list from…” from the category “Lists”

2.4. Let’s add to the list those objects that are located on the scene, except the movable object, in our case it will be the “Sphere” object. The variables of these objects can be found in the category “Objects” in the header of each required object. They will act as waypoints for the sphere

Note

In practice, it is common to use points as waypoints for ease of perception

2.5. From the category “Chains” move the “Execute chain permanently” block. Using this block will execute this chain of actions all the time, starting over when it reaches its end

2.6. Place the “Wait for N seconds” block from the category “Цепочки” and set any value you like. This will help you track the beginning and end of the chain

2.7. From the category “Objects”, find a movable object, in our case it is a sphere, and from its category “Move” pull out the block “Execute “Sphere” to move along the route N with the speed M”. As parameter N set variable “Route” from block category “Variables”. And as a parameter M set any suitable speed of movement

2.8. Place a block “Execute Sphere” stop action of any force” in the chain to eliminate the effect of collision with the last object. Using this block does not affect the physics of the Sphere object, so it will not stop moving

  1. Verify that the logic you built is correct by saving your changes to the Blockly editor and running the project
../../_images/image-4.gif

Thus, with a few objects you can easily build any, complex or simple route with an unlimited number of points, moving objects in any direction!