It was Wednesday, 17th of July. I met with a visiting scholar Xie Zuo Ru from China. Xie is an awarding-winning high school teacher in the area of technology education. His research interests focused on the use of interactive media to promote science, technology, engineering and mathematics (STEM) education. The interactive media refers to the small computers such as Arduino and Raspberry Pi that are affordable, programmable, and capable of transforming virtually any objects into input and output devices. A wide range of interactive media applications such as turning a drawing of keyboard into a real keyboard or remote control of household appliances makes the teaching and learning fun and creative. He is also an expert in robotics and programming.
In exchange, I also showed him my VRMath2 application. During our discussion, we created in less than 5 minute a simple DNA model. You can see below and if you wish, copy and paste the code into the VRMath2 to try.
INFO: Time for setup and init of GL element no. 0: 22 ms.
INFO: activate ViewpointBindable null/defaultX3DViewpointNode
INFO: register ViewpointBindable null/defaultX3DViewpointNode
INFO: create new Viewpoint for X3DViewpointNode-stack
INFO: activate BackgroundBindable null/defaultX3DBackgroundNode
INFO: register BackgroundBindable null/defaultX3DBackgroundNode
INFO: create new Background for X3DBackgroundNode-stack
INFO: System ready.
INFO: activate NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: register NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: NavType: undefined
INFO: Switch to examine mode.
INFO: create new NavigationInfo for X3DNavigationInfoNode-stack
INFO: activate EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: register EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: create new Environment for X3DEnvironmentNode-stack
INFO: setBaseURL:
INFO: webgl2 context found
Vendor: WebKit Google Inc. (Google), Renderer: WebKit WebGL ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (LLVM 10.0.0) (0x0000C0DE)), SwiftShader driver), Version: WebGL 2.0 (OpenGL ES 3.0 Chromium), ShadingLangV.: WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium), MSAA samples: 4
Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_float_blend, EXT_polygon_offset_clamp, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables, OES_shader_multisample_interpolation, OES_texture_float_linear, OVR_multiview2, WEBGL_clip_cull_distance, WEBGL_compressed_texture_astc, WEBGL_compressed_texture_etc, WEBGL_compressed_texture_etc1, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_stencil_texturing
INFO: Initializing X3DCanvas for [x3dom-1749482452813-canvas]
INFO: Inline X3D styles detected
INFO: Creating canvas for (X)3D element...
INFO: Found 1 X3D and nodes...
INFO: X3DOM 1.8.3, Build: 7482, Revison: 03da6d38708e4eafc94c2305fdc175312a880321, Date: Tue Aug 1 11:18:17 2023 +0200
; Simple DNA model
; By Andy and Xie Zuo Ru
;
CS ; clearscreen
RESET
TL 90
REPEAT 20 [ ; change 20 to larger number if you want a longer DNA model
SETSCALE 0.1 1 0.1
SETMAT 0 RANDOM 36 ; get a random material setting from set 0 in material chooser
; create a scaled can (cylinder) as a link
CAN
SETSCALE 0.25 0.25 0.25
SETMAT 6 RANDOM 36
; create 2 scaled ball (sphere) on two sides of the link as atoms
RU 90 FD 0.5 BALL BK 1 BALL FD 0.5 RD 90
FD 0.2 ; forward a little bit
UP 0.2 ; up a little bit
TL 15 ; turn a little bit
]
One of the key ideas for this simple DNA model is to show how the DNA molecule spirals in space. In VRMath2, we can use LOGO language to easily move and turn to create this model.
The DNA molecule is however, not this simple. If you are interested, please take a look of some pictures from Wikipedia, and you may create a better 3D visualisation of DNA in VRMath2.
Please leave your comments or questions, and let me know what you think. 