3d turtle graphics: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(Added Wren)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(4 intermediate revisions by 2 users not shown)
Line 8:
 
Assumes jqt and a "recent" (2022) version of J.
<langsyntaxhighlight Jlang="j">NB. pre-requisites:
NB. ;install each cut 'gl2 gles github:zerowords/tgsjo'
load'zerowords/tgsjo'
Line 82:
left 180
forward 30
roll 180</langsyntaxhighlight>
 
=={{header|Phix}}==
Line 88:
Reuses [[Simple_turtle_graphics#Phix|turtle.e]], however the code I really wanted to squirrel away has ended up in [[3d_turtle_graphics/Phix|turtle_projection.e]].
You can run this online [http://phix.x10.mx/p2js/3Dturtle.htm here].
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
-- demo\rosetta\3D_turtle_graphics.exw
Line 301:
<span style="color: #7060A8;">IupClose</span><span style="color: #0000FF;">()</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<!--</langsyntaxhighlight>-->
 
=={{header|Wren}}==
{{libheader|DOME}}
{{libheader|Wren-turtle}}
<langsyntaxhighlight ecmascriptlang="wren">import "dome" for Window
import "graphics" for Canvas, Color
import "math" for Math
import "./turtle" for Turtle, Pen
 
class Main {
Line 368:
 
// draw roof
_t.left(1510)
_t.goto(_w/8, _h/2)
_t.walk(size)
 
_t.dir = 9063
_t.walk((size*15/16).floor)
_t.back((size*15/16).floor)
 
_t.left(3044)
_t.walk((size*31/32).floor)
_t.back((size*31/32).floor)
_t.dir = 20102
_t.walk((size*16/153).floor)
 
// draw door
Line 432:
}
 
var Game = Main.new(800, 800)</langsyntaxhighlight>
9,476

edits