Can't figure out what you guys are talking about. I have a plasma TV that's as big as the sun. No static, although yesterday I mistook the sun for my set; so no matter how clear the view was, I can no longer see it. Oh well, speaking of The View, yeah, at least I'll never have to see those bitches again. So on the bright side, there's that!
if xu then
c = 255 - 50*z
if v > 0.3*2*pi then
c = c - 50*(2*pi - v)
end if
FillTriangle x1,y1, x2,y2, x3,y3, _rgb(c,c,c)
FillTriangle x3,y3, x4,y4, x1,y1, _rgb(c,c,c)
else
FillTriangle x1,y1, x2,y2, x3,y3, _rgb(0,0,0)
FillTriangle x3,y3, x4,y4, x1,y1, _rgb(0,0,0)
end if
end if
next
next
ov = ov + dv/30
if ov >= 59*dv/30 then ov = 0
_limit 30
_display
loop until _keyhit = 27
sleep
system
sub proj(x, y, z)
'parallel
'p = x + 0.707*y
'q = z + 0.707*y
roty x,y,z,a
rotx x,y,z,b
d = 10
p = x*d/(10 + y)
q = z*d/(10 + y)
end sub
sub rotx(x, y, z, a)
xx = x
yy = y*cos(a) - z*sin(a)
zz = y*sin(a) + z*cos(a)
x = xx
y = yy
z = zz
end sub
sub roty(x, y, z, a)
xx = x*cos(a) + z*sin(a)
yy = y
zz = -x*sin(a) + z*cos(a)
x = xx
y = yy
z = zz
end sub
sub rotz(x, y, z, a)
xx = x*cos(a) - y*sin(a)
yy = x*sin(a) + y*cos(a)
zz = z
x = xx
y = yy
z = zz
end sub
Sub FillTriangle (x1, y1, x2, y2, x3, y3, K As _Unsigned Long)
Static a&, m As _MEM
If a& = 0 Then a& = _NewImage(1, 1, 32): m = _MemImage(a&)
_MemPut m, m.OFFSET, K
_MapTriangle _Seamless(0, 0)-(0, 0)-(0, 0), a& To(x1, y1)-(x2, y2)-(x3, y3)
End Sub
for u=2*pi+pi/2 +du to pi step -du
xu = xu xor 1
for v=-pi to pi step dv
xu = xu xor 1
nx = sin(v)
ny = -cos(v)
nz = u
roty a
rotx b
'parallel
sx = -1
sy = -sx/0.707
sz = -0.707*sy
'perspective
sx = 0
sy = -1
sz = 0
'if (nx*sx + ny*sy + nz*sz) < 0 then
f u, v
proj
x1 = sw/2 + zoom*p - 200
y1 = sh/2 - zoom*q
'pset (x1, y1)
f u + du, v
proj
x2 = sw/2 + zoom*p - 200
y2 = sh/2 - zoom*q
'line -(x2, y2)
f u + du, v + dv
proj
x3 = sw/2 + zoom*p - 200
y3 = sh/2 - zoom*q
'line -(x3, y3)
f u, v + dv
proj
x4 = sw/2 + zoom*p - 200
y4 = sh/2 - zoom*q
'line -(x4, y4)
'line -(x1, y1)
if xu then
c = 255 - 350*((u - pi)/(2*pi + pi/2))^2
' if v > 0.3*2*pi then
' c = c - 50*(2*pi - v)
' end if
' c = 255
FillTriangle x1,y1, x2,y2, x3,y3, _rgb(c,c,c)
FillTriangle x3,y3, x4,y4, x1,y1, _rgb(c,c,c)
else
FillTriangle x1,y1, x2,y2, x3,y3, _rgb(0,0,0)
FillTriangle x3,y3, x4,y4, x1,y1, _rgb(0,0,0)
end if
'end if
next
next
_limit 100
_display
next
loop until _keyhit = 27
sleep
system
sub f(u, v)
'x = u*cos(v)
'y = u*sin(v)
'z = v
x = (1 + 0.5*v*cos(0.5*(u - t)))*cos(u - t)
y = (1 + 0.5*v*cos(0.5*(u - t)))*sin(u - t)
z = 0.5*v*sin(0.5*(u - t))
end sub
sub proj
'parallel
'p = x + 0.707*y
'q = z + 0.707*y
roty a
rotx b
d = 10
p = x*d/(10 + y)
q = z*d/(10 + y)
end sub
sub rotx(u)
xx = x
yy = y*cos(u) - z*sin(u)
zz = y*sin(u) + z*cos(u)
x = xx
y = yy
z = zz
end sub
sub roty(u)
xx = x*cos(u) + z*sin(u)
yy = y
zz =-x*sin(u) + z*cos(u)
x = xx
y = yy
z = zz
end sub
sub rotz(u)
xx = x*cos(u) - y*sin(u)
yy = x*sin(u) + y*cos(u)
zz = z
x = xx
y = yy
z = zz
end sub
Sub FillTriangle (x1, y1, x2, y2, x3, y3, K As _Unsigned Long)
Static a&, m As _MEM
If a& = 0 Then a& = _NewImage(1, 1, 32): m = _MemImage(a&)
_MemPut m, m.OFFSET, K
_MapTriangle _Seamless(0, 0)-(0, 0)-(0, 0), a& To(x1, y1)-(x2, y2)-(x3, y3)
End Sub
There's your TV static without the sound. I tend to keep my tv muted when it's got static on it, so this is what mine looks like.
That's awesome!
I guess the sound could just be white noise created with the updated sound command.
It's a little uniform. If you look at the above videos, and keep your eyes on the screen, one of them has this effect where certain pixels seem to stay lit a little longer or "float" on top. The third video is the most interesting, it's not just static but these patterns appear, as if the horizontal control on the set is drifting. That would also be interesting - simulating the "horizontal" control changing on an analog TV set.
Anyway, thanks for that bit of code, I could see that being a neat little effect in a game where you have a simulated analog TV.
(09-15-2024, 12:22 AM)bplus Wrote: Edit: Sun glasses for this one, epileptics do not watch!
Ha! Back in the Reagan years, I made a couple games on the C64 (or were it the TI99/4A) for an explosion effect.
I soon realized that staring at something like that was making my ears pop!
I think a real explosion, a single split second flash of white is more realistic.
(09-15-2024, 12:55 AM)bplus Wrote: Eye Candy #10 for @madscijr
...
Pretty cool!
Gets a little painful to stare at... I was looking for something a little smoother.
I'll get something working soon I hope, if the distractions don't keep happening!
09-15-2024, 02:44 PM (This post was last modified: 09-15-2024, 02:47 PM by madscijr.)
(09-15-2024, 01:03 AM)Pete Wrote: Can't figure out what you guys are talking about. I have a plasma TV that's as big as the sun. No static, although yesterday I mistook the sun for my set; so no matter how clear the view was, I can no longer see it. Oh well, speaking of The View, yeah, at least I'll never have to see those bitches again. So on the bright side, there's that!
Pete
You poor child! You must be reading this on a Braille computer display (I imagine those must really exist?)
(09-15-2024, 09:24 AM)vince Wrote: if this isn't a mod
Code: (Select All)
...
Impressive!
That would make a cool background for a quasi-3D space invaders type game, with the tunnel taking some twists and turns, and the player needs to steer to avoid the walls as well as shoot the aliens...
(09-15-2024, 01:03 AM)Pete Wrote: Can't figure out what you guys are talking about. I have a plasma TV that's as big as the sun. No static, although yesterday I mistook the sun for my set; so no matter how clear the view was, I can no longer see it. Oh well, speaking of The View, yeah, at least I'll never have to see those bitches again. So on the bright side, there's that!
Pete
You poor child! You must be reading this on a Braille computer display (I imagine those must really exist?)
(09-15-2024, 09:24 AM)vince Wrote: if this isn't a mod
Code: (Select All)
...
Impressive!
That would make a cool background for a quasi-3D space invaders type game, with the tunnel taking some twists and turns, and the player needs to steer to avoid the walls as well as shoot the aliens...
" Braille computer display (I imagine those must really exist?) "
Yes they do and have existed for a very long time. Back in the early 90's when I was a computer tech I serviced a blind person's system at a local bank. He was a loan officer. He used a combination of a Braille display and optical hand held screen reader. The Braille display would bring up a line of text as he panned the optical reader over the CRT. It was quite cumbersome to use but he made it work. I imagine today's systems are much more sophisticated.
" Impressive! "
I agree, those animations are awesome vince!
New to QB64pe? Visit the QB64 tutorial to get started. QB64 Tutorial