{"id":20273,"date":"2023-08-08T14:43:39","date_gmt":"2023-08-08T21:43:39","guid":{"rendered":"https:\/\/www.kith.org\/jed\/?page_id=20273"},"modified":"2023-08-14T11:47:41","modified_gmt":"2023-08-14T18:47:41","slug":"examples-from-the-vrml-2-0-handbook-chapters-5-6","status":"publish","type":"page","link":"https:\/\/www.kith.org\/jed\/hodgepodge\/code\/3d-graphics-in-vrml\/examples-from-the-vrml-2-0-handbook\/examples-from-the-vrml-2-0-handbook-chapters-5-6\/","title":{"rendered":"Examples from the VRML 2.0 Handbook: chapters 5-6"},"content":{"rendered":"\r\n<script src=\"https:\/\/create3000.github.io\/code\/x_ite\/latest\/x_ite.min.js\"><\/script>\r\n<style>\r\nx3d-canvas {\r\n  width: 600px;\r\n  height: 300px;\r\n}\r\ndiv.x3d-canvas {\r\n  width: 600px;\r\n  margin-left: auto;\r\n  margin-right: auto;\r\n}\r\np.download {\r\n  text-align: center;\r\n  text-indent: 0;\r\n  margin: 10px;\r\n}\r\nhr {\r\n  margin-top: 40px;\r\n  margin-bottom: 40px;\r\n}\r\n<\/style>\r\n\r\n<p>This page shows the example 3D models from chapters 5 and 6 of the <cite>The VRML 2.0 Handbook<\/cite>, by Jed Hartman and Josie Wernecke. For more information, see my main <a href=\"https:\/\/www.kith.org\/jed\/hodgepodge\/code\/3d-graphics-in-vrml\/examples-from-the-vrml-2-0-handbook\/\">Handbook examples page<\/a>.<\/p>\r\n<p>In some cases, the download links download a Zip file containing the main VRML file plus any other associated files that the main file relies on, such as textures.<\/p>\r\n\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Unnumbered example (ch. 5, p. 100): Point light<\/h2>\r\n<p>Shows a cube lit by a point light.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/05.pointlight.wrl\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20409\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 206px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/pointlight.gif\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/pointlight.gif\" alt=\"Unnumbered example.\" width=\"196\" height=\"122\" class=\"size-full wp-image-20409\" \/><\/a><figcaption class=\"caption wp-caption-text\">Unnumbered example.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/05.pointlight.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Unnumbered example (ch. 5, p. 108): Elevation grid<\/h2>\r\n<p>Shows an elevation grid.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/05.elevationgrid.wrl\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20410\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 206px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/elevation.gif\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/elevation.gif\" alt=\"Unnumbered example.\" width=\"196\" height=\"122\" class=\"size-full wp-image-20410\" \/><\/a><figcaption class=\"caption wp-caption-text\">Unnumbered example.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/05.elevationgrid.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Unnumbered example (ch. 6, p. 117): Light switch<\/h2>\r\n<p>Shows a sphere and a box. To turn on the light, click the sphere. The light stays on until you release the mouse button.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.light.zip\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20414\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 310px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6-lightswitch.png\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6-lightswitch-300x148.png\" alt=\"Unnumbered example.\" width=\"300\" height=\"148\" class=\"size-medium wp-image-20414\" \/><\/a><figcaption class=\"caption wp-caption-text\">Unnumbered example.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.light.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Example 6-1: Using a TouchSensor node<\/h2\r\n<p>Shows a glowing circular button. To make the doorbell buzz, press the button.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.01.buzzer.zip\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20415\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 310px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6-1.png\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6-1-300x147.png\" alt=\"Example 6-1.\" width=\"300\" height=\"147\" class=\"size-medium wp-image-20415\" \/><\/a><figcaption class=\"caption wp-caption-text\">Example 6-1.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.01.buzzer.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Example 6-2: Using a PlaneSensor node<\/h2>\r\n<p>Shows a model of a skull. You can drag the skull left and right.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.02.skull.zip\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20386\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 206px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.02.gif\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.02.gif\" alt=\"Example 6-2.\" width=\"196\" height=\"122\" class=\"size-full wp-image-20386\" \/><\/a><figcaption class=\"caption wp-caption-text\">Example 6-2.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.02.skull.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Example 6-3: Using a ProximitySensor node<\/h2>\r\n<p>Shows the chacmool. Move forward a little to start the light brightening. If you don\u2019t see the brightening, then move back until the chacmool is in the middle distance, and move forward again. At a certain point, the light gets dim and then brightens again.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.03.prox.zip\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20387\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 206px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.03.gif\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.03.gif\" alt=\"Example 6-3.\" width=\"196\" height=\"122\" class=\"size-full wp-image-20387\" \/><\/a><figcaption class=\"caption wp-caption-text\">Example 6-3.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.03.prox.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n<h2>Example 6-4: Using an interpolator<\/h2>\r\n<p>Shows a spark coming out of the brazier. This code is slightly different from the example in the book; it uses a small sphere instead of a point set, because the point set doesn\u2019t render.<\/p>\r\n<p>To start the animation, click the brazier. The spark (a small yellow sphere) flies up from the coals and then stops.<\/p>\r\n<p class=\"download\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.04.sparkPC.zip\">Download<\/a><\/p>\r\n<h3>Preview image<\/h3>\r\n<figure id=\"attachment_20388\" class=\"thumbnail wp-caption aligncenter\" style=\"width: 206px\"><a href=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.04.gif\"><img src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/6.04.gif\" alt=\"Example 6-4.\" width=\"196\" height=\"122\" class=\"size-full wp-image-20388\" \/><\/a><figcaption class=\"caption wp-caption-text\">Example 6-4.<\/figcaption><\/figure>\r\n<h3>Live demo<\/h3>\r\n<div class=\"x3d-canvas\">\r\n<x3d-canvas src=\"https:\/\/www.kith.org\/jed\/wp-content\/uploads\/sites\/2\/2023\/08\/06.04.sparkPC.wrl\"><\/x3d-canvas>\r\n<\/div>\r\n<hr width=\"25%\" \/>\r\n\r\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"parent":20177,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-20273","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/20273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/comments?post=20273"}],"version-history":[{"count":22,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/20273\/revisions"}],"predecessor-version":[{"id":20507,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/20273\/revisions\/20507"}],"up":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/20177"}],"wp:attachment":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/media?parent=20273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}