hotn-gay-digital-garden/twitter/tweets/11_8_2020.md
2026-02-15 21:39:13 -06:00

41 lines
1.2 KiB
Markdown

{{{
"planted": "11/8/2020",
"repotted": "1/4/2026",
"nobreak": "true"
}}}
* I guess this isn't really a game, but I made a .obj 3D model file viewer for #TweetTweetJam5! It takes real .obj file data, converts it into Pico-8 memory, and then renders it in wireframe! Mess with it here: [https://valeradhd.itch.io/obj-fv-ttj5](https://valeradhd.itch.io/obj-fv-ttj5)
(Source in replies)
#pico8
![](media/11_8_2020.gif)
<div class="code"><p>
cls()u=unpack
p={}e={}q=0w=0m=1s=split::x::
o=stat(4)print("paste in .obj file",28,61)
if(#o<1)goto x
for i in all(s(o,"\n"))do
d=s(i," ")
if(ord(i)==118)add(p,d)
if(ord(i)==108)add(e,d)end
camera(-64,-64)::_::
cls()s=sin(q)d=cos(q)f=sin(w)g=cos(w)for i in all(e)do
_,x,y,z=u(p[i[2]])_,a,b,c=u(p[i[3]])x,z=x*d+z*s,d*z-x*s
a,c=a*d+c*s,d*c-a*s
y,z=y*g-z*f,y*f+z*g
b,c=b*g-c*f,b*f+c*g
a*=m
b*=m
c*=m
x*=m
y*=m
z*=m
c-=4z-=4x=x/z*64y=y/z*64a=a/c*64b=b/c*64line(x,y,a,b)end
b=btn()q+=(b\2%2-b%2)/30w+=(b\8%2-b\4%2)/30
if(btn(4))m+=.01
if(btn(5))m-=.01
flip()goto _
</p></div>
*gardener's note: I'm still shocked I was able to get this to work. It's one of my favorite proof-of-concept pieces I've done, even if the ""input"" method makes it near impossible to use (can't abuse the paste function on mobile devices)*