Helium atom
Since version 0.9.1 of VRMath2 Editor, animation has become quite easy. I have previously made a hydrogen atom and now I can't resist to create the second one in the periodic table, the helium atom.
Although my motivation of making these atom simulation or visualisation is mainly to demonstrate the new animation features, I also have many ideas about what learnings can happen for students and what learning experiences can be done by teachers in doing these chemical elements in 3D virtual space. (Btw, did anyone also think about the Big Bang Theory clip? :-) )
Firstly, let me talk about the programming part of making this helium atom.
A helium atom has two protons (represented in red) and two neutrons (represented in green) in the nucleus, and two electrons orbiting the nucleus. I actually started with the programming of a "wiggling" protons and neutrons. Using TRAVEL command is quite easy to produce this wiggle or wriggle effect.
; wiggle proton or neutron CS RESET SETSCALE .4 .4 .4 ; setmat 5 29 ; for red proton SETMAT 5 10 ; for green neutron BALL TRAVEL OBJECT [[0 0 0][0 .02 0][0 0 0][0 -.02 0][0 0 0]] 2 SHOWALL
The traveling path, as can be seen, is slightly moving up and down along the Y axis. With these two single proton and single neutron saved as x3d files (without any NavigationInfo, Viewpoint, Background), I am ready to insert them into the real Helium atom world.
; Helium atom ; By Andy Yeh (2014) CS RESET SETBG 34 TRANSFORM ; create a coordinate group obj_0 for animation purpose later SETPARENT OBJECT ; make this coordinate group the parent of objects created after SETEC 0 0 1000 ; set emissive colour (blue) for orbit CIRCLE ; create a circle (r=1) as the orbit of electron obj_1 UP 1 ; move the turtle to the orbit SETSCALE .2 .2 .2 ; size for electron SETMAT 0 15 ; material for electron BALL ; create an electron obj_2 DN 2 ; move to the other side of the orbit BALL ; create another electron obj_3 HOME SETSCALE 1 1 1 ; return default scale SETPARENT "root ; leave the coordinate system REPEAT 2 [ RT RANDOM 360 TL RANDOM 360 RU RANDOM 360 ; get some random direction FD 0.15 ; away from the center WORLD "/sites/default/files/user/u3/world/proton.x3d ; insert an animated proton BK 0.15 ; back to center ] REPEAT 2 [ RT RANDOM 360 TL RANDOM 360 RU RANDOM 360 ; get some random direction FD 0.15 ; away from the center WORLD "/sites/default/files/user/u3/world/neutron.x3d ; insert an animated neutron BK 0.15 ; back to center ] SHOWALL ; bring everything to fit screen ; start animation from here ; the first spin is on obj_0. Because the electron is 1 meter away from the centre so ; it spins (tilt right) like orbiting the proton once every 4 seconds. SPIN "obj_0 "tiltright 4 ; next, I spin the orbit to the right direction once every 20 seconds. SPIN "obj_1 "right 20
The neutrons and protons are inserted into random locations and directions as can be seen from line 18 to 29, to produce the wriggling effect. Because their directions are random, therefore the wiggle is not just up and down. Every time I run the program above will produce slightly different necleus. Eventually I published this one below.
As for teaching and learning ideas, I will leave to the comments below.
- Andy's blog
- Login or register to post comments
- 20300 reads
Comments
Nice work
Really likem the new animation comands (if thats what they're called). Could you create a list of attributes a 3D object has as I'm trying to do some interactive projects.
Thanks a lot, Mathskid
Interactive projects
You are most welcome to discuss the interactive projects you have in mind in the forum. I will try my best to assist.
Animation and attributes of 3D object
I have not yet create video tutorials about animation, but if interested, check out this forum posts for some details.
https://vrmath2.net/forum/designer-forums/logo-programming-forum
You may also discuss in the forum about what you mean by Attributes of 3D object and what do they do for animation??
Good to see you back.
Sorry for reapeat
Sorry for the repeat. Do you Know how to delete this?
Need review...
I just realised that users can't delete own comments... I will investigate. The Webmaster has removed the repeated comment.
Teaching idea #1: 3D rotation
If running the above Logo program up to line 15 in VRMath2 Editor, then you will get the orbit with 2 electrons as the image below:
The tree structure of this virtual world is:
Now if applying line 34: SPIN "obj_0 "tiltright 4, what will happen?
What if then applying line 36: SPIN "obj_1 "right 20, what will happen?
How long (how many seconds) did you see the spins repeat, why?
What if the cycleInterval 4 in number 34 changed to 6, what will happen? and how long will you see a repeat?
The tricky 3D rotation
What happens if:
Line 9 change to EAST 1
Line 13 change to WEST 2