Jump to content

WebGL rotating F: Difference between revisions

m
→‎{{header|J}}: ... use javascript syntax highlight here
m (→‎{{header|J}}: ... use javascript syntax highlight here)
Line 19:
Here, we'll use ray marching as that "feels sort of like J":
 
<syntaxhighlight lang=Jjavascript>webgl_close=: {{ wd'pclose'}}
wd {{)n
pc webgl; cc w webview;
Line 95:
float sd= rayMarch(ro, rd, MIN_DIST, MAX_DIST); // closest object
if (sd > MAX_DIST) {
color= backgroundColor; // ray didn'tdid not hit anything
} else {
vec3 p= ro + rd * sd; // point on cube we discovered from ray marching
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.