{"id":169,"date":"2022-01-29T17:39:00","date_gmt":"2022-01-29T16:39:00","guid":{"rendered":"http:\/\/www.alzinger.de\/wp1\/?page_id=169"},"modified":"2022-01-30T14:15:07","modified_gmt":"2022-01-30T13:15:07","slug":"marble-machine-making-of-4","status":"publish","type":"page","link":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/","title":{"rendered":"Marble machine making of 4"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"collision\">Collision<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For detecting a collision of a marble with an other Object (the yellow box) I use the trace command. By creating (green) Vectors from the middle of the sphere, I must trace all vectors and find the collision point (or not). If this point is inside the sphere, I add the part of the red Vector which is inside the yellow box to the speed vector of the marble.<br>In the real scene I use 10 times more collision vectors than in this demo.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"schusserbahn collision\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/C-4KPWAa2GU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:9px\"><code>#macro collision (pos,s,sp,rot,rot_inc obj)      \n    #declare xi=0;\n    #while (xi&lt;360)      \n        #declare yi=0;\n        #while (yi&lt;180)                 \n            #declare Hit_Normal = &lt;0,0,0&gt;;\n            #declare ve = &lt;0,0,1&gt;;\n            #declare ve =vrotate (ve, &lt;xi,yi,0&gt;);\n            #declare treffer = trace (obj,pos,ve,Hit_Normal);\n            #if (vlength( Hit_Normal) !=0)\n                #if( vlength(pos - treffer)&lt; s)\n                    #declare pos= pos + Hit_Normal*(s-vlength(pos - treffer));\n                    #declare sp = sp  + Hit_Normal*((s*1.016)-vlength(pos - treffer));  \n                #end#end#declare yi = yi +60.0;\n        #end\n     #end\n#end<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Collision For detecting a collision of a marble with an other Object (the yellow box) I use the trace command. By creating (green) Vectors from the middle of the sphere, I must trace all vectors and find the collision point (or not). If this point is inside the sphere, I add the part of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":70,"menu_order":20,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-169","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Marble machine making of 4 - www.alzinger.de<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Marble machine making of 4 - www.alzinger.de\" \/>\n<meta property=\"og:description\" content=\"Collision For detecting a collision of a marble with an other Object (the yellow box) I use the trace command. By creating (green) Vectors from the middle of the sphere, I must trace all vectors and find the collision point (or not). If this point is inside the sphere, I add the part of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/\" \/>\n<meta property=\"og:site_name\" content=\"www.alzinger.de\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-30T13:15:07+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/marble-machine-making-of-4\\\/\",\"url\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/marble-machine-making-of-4\\\/\",\"name\":\"Marble machine making of 4 - www.alzinger.de\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/#website\"},\"datePublished\":\"2022-01-29T16:39:00+00:00\",\"dateModified\":\"2022-01-30T13:15:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/marble-machine-making-of-4\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/marble-machine-making-of-4\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/marble-machine-making-of-4\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Robert\",\"item\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Raytracing\",\"item\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Marble Machine in Povray\",\"item\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/robert\\\/raytracing\\\/marble-machine-in-povray\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Marble machine making of 4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/#website\",\"url\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/\",\"name\":\"www.alzinger.de\",\"description\":\"Familie Alzinger\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.alzinger.de\\\/wp1\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Marble machine making of 4 - www.alzinger.de","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/","og_locale":"de_DE","og_type":"article","og_title":"Marble machine making of 4 - www.alzinger.de","og_description":"Collision For detecting a collision of a marble with an other Object (the yellow box) I use the trace command. By creating (green) Vectors from the middle of the sphere, I must trace all vectors and find the collision point (or not). If this point is inside the sphere, I add the part of the [&hellip;]","og_url":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/","og_site_name":"www.alzinger.de","article_modified_time":"2022-01-30T13:15:07+00:00","twitter_card":"summary_large_image","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/","url":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/","name":"Marble machine making of 4 - www.alzinger.de","isPartOf":{"@id":"https:\/\/www.alzinger.de\/wp1\/#website"},"datePublished":"2022-01-29T16:39:00+00:00","dateModified":"2022-01-30T13:15:07+00:00","breadcrumb":{"@id":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/marble-machine-making-of-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/www.alzinger.de\/wp1\/"},{"@type":"ListItem","position":2,"name":"Robert","item":"https:\/\/www.alzinger.de\/wp1\/robert\/"},{"@type":"ListItem","position":3,"name":"Raytracing","item":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/"},{"@type":"ListItem","position":4,"name":"Marble Machine in Povray","item":"https:\/\/www.alzinger.de\/wp1\/robert\/raytracing\/marble-machine-in-povray\/"},{"@type":"ListItem","position":5,"name":"Marble machine making of 4"}]},{"@type":"WebSite","@id":"https:\/\/www.alzinger.de\/wp1\/#website","url":"https:\/\/www.alzinger.de\/wp1\/","name":"www.alzinger.de","description":"Familie Alzinger","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.alzinger.de\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"}]}},"_links":{"self":[{"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/pages\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":5,"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/pages\/169\/revisions\/331"}],"up":[{"embeddable":true,"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/pages\/70"}],"wp:attachment":[{"href":"https:\/\/www.alzinger.de\/wp1\/wp-json\/wp\/v2\/media?parent=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}