Tutorials

Use MAKAR to learn physics-Let's make an AR cannon!

1. Please download the file of cannon.zip and decompress it, import them to MAKAR.
https://drive.google.com/file/d/1HdJHrGcdfRRikf1zViDViWFNuRBjVmCz/view?usp=sharing
Click "New Project"> "Space Recognition", and enter the project name.
Click "OK".





2. To the left side find and click "New Resources"  >  "3D Model"





3. Find these two files and import them to the resources.




 
4. Import image and audio to the resources, Click "New Resources"  > "image" and "New Resources"  > "Audio".





5. All of the resources were done, drag them to the scene and start to edit objects and arrange logic.

Drag the object of the cannon to the scene and edit  position, rotate, scale. Cancel interactable and add action logic.

drag cannon to the scene.




6. Set the position, rotate, scale on the right side. And turn off the interactable.





7. Click "Add Action">"Logic"






It's how it looked when you were done every steps.





8. Drag  the object of wheel  to the scene and edit position, rotate, scale. Cancel interactable and add action logic.





9. Next on, drag the image of arror-right,arror-left,arror-up,arror-down,fire to the scene, and edit position, rotate, scale. 





10. Cancel interactable and add action logic.





11. Drag the video of explosion to the scene,  and edit position, rotate, scale. Cancel interactable and add action logic.






12. Drag the video of explosion to the scene,  and edit position, rotate, scale. Cancel interactable and add action logic.





13. Drag the music to the scene and edit its position.  Cancel interactable and add action logic.
 




14. Add the light and drag it to the scene.







Edit the light’s position, rotate, and lighting strength.



【Group】

arror-rightt, arror-left, arror-up, arror-down, fire, drag these five objects to the "wheel" object  to make them become a group. Being a group is the most convenient way in MAKAR.  So that there would be a triangle icon on the left top.  You can open and close these objects easily.

Drag fire object to the wheel and drop it to make it into the group.



15. Drag Sphere to the scene, and edit the position and size. Cancel interactable and add action logic.






16. Click two times on the Sphere to edit the name into "ball”





17. Click logic to arrange logic.



Logic:






1. There are different blocklies on the left. Please drag one blockly into the blank space to start.




Use variables to design every deta.
 

variables name  
project
value variables name project value
ax cannon-x coordinates 0 vx ball-x direction velocity 0
ay cannon-y coordinates 0.24 vy ball-y direction velocity 0.3
az Cannon-z coordinates 0.1 vz ball-z direction velocity 0.4
bx ball-x coordinates 0 dvy ball-y direction velocity effected by carron's height 0.1
by ball-y coordinates 0.33 dvz  
ball-z direction velocity effected by by carron's height
 
0.05
bz ball-z coordinates 0.4 xx canoon right left moving distance 0.1
cx wheel-x coordinates 0 th setting the angle of cannon's up and down 10
cy wheel-y coordinates 0.18 bx1 ball-x coordinates 
staging value
 
cz wheel-z coordinates 0.14 by1 ball-y coordinates 
staging value
 
      bz1 ball-z coordinates 
staging value
 




About variables
1. Drag the blockly of variables, and drop it to  create a variable. Arrange every value according to this sheet.

  



It is how it looked after creating variables.




2. Drag bx blocky to the right.





3. Click ”Data” > “1”, and drag it to the bx blockly’s right side. Edit value to 0.

  



【Editting  Variables】





Click the right arrow and the cannon will be moved right.

1. Click and drag “Events” > "when…is clicked". Choose “arror-rijgt”for the transform item.

 


2. Click and drag “Controls” > “If…” to the editing space.

 


3. Click and drag “Variables” > “bx blockly” like this.





4. Click and drag “Transform” > “move…to…in…sec” to the editing space





5. Click and drag “Operators” > “...+...” to the editing space.





6. Click and drag “Variables” > "set…to…", and edit its different variables.






7. Please edit the last variables to finish moving right.



 

8. Click the copy icon on the left up side. So that it will come up a whole blockly.


 

 
【Click the left arrow and the cannon will be moved left.】

Coped blockly can be edited for moving left.



【Click the up arrow and the cannon will be upped.】
 
When by value is bigger than 0.6, it will be stopped.
 

 
 

Click the down arrow and the cannon will be raised.

When by value is smaller than 0.331, it will be stopped.


 


【Trajectory of a cannon】



※ vy value is the same as the variables of vy value.
1. vx value could be 0 because there is no speed of  x direction for cannon.
vz is the z direction, when vz is bigger speed will faster. 
Therefore every loop will go straight  regulately.
z direction is motion with constant velocity.





2. 

y direction, after the cannon is shooted, it will be affected by gravity.
Up speed will be more and more small unitil achieving the max. And starts to go down.

vy value, it is original speed of going up, so that the more vy value it goes, the far height is.
And the vy value is going small by getting higher. It will decrease by 0.05 each time it is looped.

by1, it is y direction of updating staging value,the more by value increases, the less vy value decreases.
When height is going to max, vy value will go to minus, and then the cannon will go down.




 

3. Finish all of canonn design.
Finally, close the eye of “ball” and “explosion” to not show them.



4. Click “Publish”.