WebGL rotating F: Difference between revisions
m
syntax highlighting fixup automation
(Added Wren) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 15:
=={{header|Julia}}==
Makie can use OpenGL as a backend for plotting (GLMakie). The code plots an 'F' as three rectangular solid-shaped scatter plots with overlapping markers, then rotates the resulting graph.
<
using GeometryBasics: Rect3f
using GLMakie
Line 36:
sleep(0.25)
end
</syntaxhighlight>
=={{header|Phix}}==
You can run this online [http://phix.x10.mx/p2js/HelloF.htm here] (which gives me around 10% CPU load, with space toggling the timer for no extra load). No teapot, sorry.
<!--<
<span style="color: #000080;font-style:italic;">--
-- demo\pGUI\HelloF.exw
Line 423:
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<!--</
=={{header|Wren}}==
Line 435:
As with any Open GL aplication, the Wren code needs to be embedded in a host application which can communicate directly with the relevant libraries and which I've written here in C.
<
import "./math" for Math
Line 1,129:
Glut.setOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS)
init.call()
drawScene.call()</
<br>
We now embed the above code in the following C program, compile and run.
<
#include <stdlib.h>
Line 1,455:
free(script);
return 0;
}</
|