Earth Cross Section
In the X3DOM mailing list, there was a discussion about constructing solid geometry. One application of solid geometry is to model the cross section of Earth. Unfortunately, solid geometry is not supported in X3DOM. However, the cross section can be achieved by using other geometry available in X3DOM. Here is an example.
The geometry nodes used to achieve the above model are DISH and PIE, there are not included in the normal x3dom.js but as extra components in Geometry2D.js and Geometry3DExt.js, which can be downloaded from http://x3dom.org/download/dev/components/. In VRMath2 I have included them by default.
I construct the above Earth cross section in my VRMath2 Editor using Logo programming language. It is actually quite easy to construct. Interactions and animations such as add shell or remove shell can also be easily added. Leave a comment below and let me know your ideas about what interaction and animation you would like to see. Below are the Logo program to create the Earth cross section 3D world.
; earth cross section ; By Andy Yeh (2015) CS RESET ; clear screen and reset SETBG 25 ; set background #25 RU 180 ; roll up 180 degrees SETMAT 6 11 ; set material index as in material chooser DISH ; dish is a 3D extension component. It is actually a hemisphere. SET WORD OBJECT "_dish "bottom FALSE ; remove the bottom of the dish LT 45 TL 90 ; left turn 45 degrees then tilt left 90 degrees DISH SET WORD OBJECT "_dish "bottom FALSE RU 90 DISH SET WORD OBJECT "_dish "bottom FALSE TL 180 ; tile left 180 degrees so the pie can be at the right place SETMAT 6 10 PIE ; pie is a 2D shape in the Geometry2D.js BK 0.001 ; back a little bit to avoid render clash SETSCALE .97 .97 .97 ; make the pie smaller so it looks like different layers SETMAT 6 28 PIE ; another layer BK 0.001 SETSCALE .8 .8 .8 SETMAT 6 26 PIE ; another layer BK 0.001 SETSCALE .35 .35 .35 SETMAT 6 24 PIE ; another layer FD 0.003 ; forward 0.003 as previously back 3 times of 0.001 TR 90 RT 90 ; some 3D rotation of the turtle... tilt right 90 degrees then right turn 90 degrees SETSCALE 1 1 1 SETMAT 6 10 PIE BK 0.001 SETSCALE .97 .97 .97 SETMAT 6 28 PIE BK 0.001 SETSCALE .8 .8 .8 SETMAT 6 26 PIE BK 0.001 SETSCALE .35 .35 .35 SETMAT 6 24 PIE FD 0.003 TR 90 RT 90 SETSCALE 1 1 1 SETMAT 6 10 PIE BK 0.001 SETSCALE .97 .97 .97 SETMAT 6 28 PIE BK 0.001 SETSCALE .8 .8 .8 SETMAT 6 26 PIE BK 0.001 SETSCALE .35 .35 .35 SETMAT 6 24 PIE
The above program can be open in VRMath2 Editor's Logo Editor (get from Window menu). Or you may wish to download the logo and x3d files below.
- Andy's blog
- Login or register to post comments
- 16540 reads
Comments
Another cool cross section model
Here is another cool cross section model by John Carlson at http://coderextreme.net/earth (using three.js). A x3dom example by John is at http://coderextreme.net/earth/world.html.
Another interactive model in VRMath2 can be found at https://vrmath2.net/content/interactive-earth-cross-section