|
Post by xxgeek on Nov 6, 2022 23:44:29 GMT
|
|
|
Post by plus on Nov 7, 2022 0:17:50 GMT
Ah, not even inclined to try ;-)) BUT all is not lost, a couple of these look very interesting beesandbombs.tumblr.comThe first one and "stars and squares" have peeked my interest.
|
|
|
Post by tsh73 on Nov 7, 2022 21:22:12 GMT
I think if we put that thing on a torus - nearer tube then donut so inner cube is inside and outer on the tube outer part, and start to rotate matter of the torus (suppose it is rubber one, like a bike camera), then points of a figure where inner cube connected to outer one (red circles) will move on a perpendicular section to that torus Likely an ellipse (red dashed line). So if we just move 4 points along 4 ellipses, and connect these points, we likely get something similar to rotating hypercube.
|
|
|
Post by plus on Nov 8, 2022 1:18:34 GMT
marshawn where'd your post go? It was a start, tsh73 would have fixed up nice!
|
|
|
Post by marshawn on Nov 8, 2022 1:43:30 GMT
H$ = "gr"
global pi, p, q, sw2, sh2, d, z0, t, t2, t3, f, zoom
f = 0 pi = 4*atn(1)
zoom = 3
nomainwin sw = 800 sh = 600 sw2 = sw/2 sh2 = sh/2 WindowWidth = sw WindowHeight = sh
open "Affine Plane" for graphics_nsb_nf as #gr #gr "trapclose quit" #gr "down" #gr "fill white" #gr "backcolor black" #gr "color black" #gr "down" #gr "home; posxy cx cy"
d = 700 z0 = 1500
dim x(16), y(16), z(16), w(16) x( 0)=0-1: y( 0) =0-1: z( 0) =0-1: w( 0) = 0-1 x( 1)= 1: y( 1) =0-1: z( 1) =0-1: w( 1) = 0-1 x( 2)= 1: y( 2) = 1: z( 2) =0-1: w( 2) = 0-1 x( 3)=0-1: y( 3) = 1: z( 3) =0-1: w( 3) = 0-1 x( 4)=0-1: y( 4) =0-1: z( 4) = 1: w( 4) = 0-1 x( 5)= 1: y( 5) =0-1: z( 5) = 1: w( 5) = 0-1 x( 6)= 1: y( 6) = 1: z( 6) = 1: w( 6) = 0-1 x( 7)=0-1: y( 7) = 1: z( 7) = 1: w( 7) = 0-1 x( 8)=0-1: y( 8) =0-1: z( 8) =0-1: w( 8) = 1 x( 9)= 1: y( 9) =0-1: z( 9) =0-1: w( 9) = 1 x(10)= 1: y(10) = 1: z(10) =0-1: w(10) = 1 x(11)=0-1: y(11) = 1: z(11) =0-1: w(11) = 1 x(12)=0-1: y(12) =0-1: z(12) = 1: w(12) = 1 x(13)= 1: y(13) =0-1: z(13) = 1: w(13) = 1 x(14)= 1: y(14) = 1: z(14) = 1: w(14) = 1 x(15)=0-1: y(15) = 1: z(15) = 1: w(15) = 1
t=0 for t = 3*pi to pi step 0-0.05 'for t = 0 to 0 #gr "cls" #gr "color black" f=0 i = 0 call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q for i=1 to 3 call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q next i = 0 call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q
i = 4 call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q for i=4 to 7 call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q next i = 4 call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q
for i = 0 to 3 call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q call proj x(i+4), y(i+4), z(i+4), w(i+4) #gr "goto ";p;", ";q next
'''''' f=1 k=8 '''''' #gr "color red" i = 0+k call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q for i=1+k to 3+k call proj x(i),y(i), z(i), w(i) #gr "goto ";p;", ";q next i = 0+k call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q
i = 4+k call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q for i=4+k to 7+k call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q next i = 4+k call proj x(i), y(i), z(i), w(i) #gr "goto ";p;", ";q
for i = 0+k to 3+k call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q call proj x(i+4), y(i+4), z(i+4), w(i+4) #gr "goto ";p;", ";q next
#gr "color black"
for i=0 to 7 f = 0 call proj x(i), y(i), z(i), w(i) #gr "place ";p;", ";q f = 1 call proj x(i+k), y(i+k), z(i+k), w(i+k) #gr "goto ";p;", ";q next
'scan #gr "flush" call pause 100
next wait
sub proj x, y, z, w 'xx = x*cos(t) - w*sin(t) 'yy = y 'zz = z 'ww = x*sin(t) + w*cos(t)
xx = x yy = y*cos(t) - w*sin(t) zz = z ww = y*sin(t) + w*cos(t)
xx = 3*xx/(3 - ww) yy = 3*yy/(3 - ww) zz = 3*zz/(3 - ww)
xxx = xx*cos(2*pi - t) - zz*sin(2*pi - t) zzz = xx*sin(2*pi - t) + zz*cos(2*pi - t) xx = xxx zz = zzz
a = pi/3 b = pi/12 xxx = xx*cos(a) - yy*sin(a) yyy = xx*sin(a) + yy*cos(a) xx = xxx yy = yyy
yyy = yy*cos(b) - zz*sin(b) zzz = yy*sin(b) + zz*cos(b) yy = yyy zz = zzz
xx = 100*xx yy = 100*yy zz = 100*zz
p = sw2 + 2*xx*d/(yy + z0) q = sh2 - 2*zz*d/(yy + z0) end sub
sub quit Hdl$ close #Hdl$ end end sub
sub pause mil tt=time$("ms")+mil while time$("ms")<tt scan wend end sub
|
|
|
Post by xxgeek on Nov 8, 2022 4:31:24 GMT
@ marshawn - WOW, that was fast. Excellent Marshawn. Looks even better with a slight size = change Looking at the code makes me dizzy. Did you write this code after I posted this?
@ B+ I wasn't sure if JB was even capable, now I know. The link you posted had quite a few nice videos of his work. I liked one on page 6, 4th one down. It looks like it may be fairly easy to code. It caught my attention. That guy is amazing too. Probably uses a faster language than JB.
@ tsh - I have no doubts you'll have a version up soon too.
@ All of you. You guys/gals (who knows these days) amaze me with your math skills. Years ago I wrote a few graphic things on a TRS-80, some in basic, some in assembler, but nothing like you people do. Great stuff, and ral eye catching at times.
Possibly I can join in one day and create along with the rest of you, if I read enough of your code maybe I'll catch on again, but my math skills have evaporated over the years.
Thanks for posting. I enjoy trying and playing with the graphics code, if only to change numbers here and there to se what happens on screen.
|
|
|
Post by marshawn on Nov 8, 2022 9:25:36 GMT
a simpler shape
H$ = "gr"
global pi, p, q, sw2, sh2, d, z0, t, t2, t3, f, zoom
f = 0 pi = 4*atn(1)
zoom = 3
nomainwin sw = 800 sh = 600 sw2 = sw/2 sh2 = sh/2 WindowWidth = sw WindowHeight = sh
open "Affine Plane" for graphics_nsb_nf as #gr #gr "trapclose quit" #gr "down" #gr "fill black" #gr "backcolor black" #gr "color white"
d = 700 z0 = 1500
't=0 for t = 0 to 2*pi step 0.05 #gr "fill black"
sv = 2*pi/30 su = 2*pi/10
for v=0 to 2*pi step sv x = cos(u) y = sin(u) z = cos(v) w = sin(v) call proj x, y, z, w #gr "place ";p;", ";q
for u=0 to 2*pi step su
x = cos(u) y = sin(u) z = cos(v) w = sin(v)
call proj x, y, z, w c = 255 #gr "color ";c;" ";c;" ";c #gr "goto ";p;", ";q
scan next next '#gr "color red" for u=0 to 2*pi step su x = cos(u) y = sin(u) z = cos(v) w = sin(v) call proj x, y, z, w #gr "place ";p;", ";q
for v=0 to 2*pi step sv
x = cos(u) y = sin(u) z = cos(v) w = sin(v)
call proj x, y, z, w c = 255 #gr "color ";c;" 0 0" #gr "goto ";p;", ";q
scan next next
'scan #gr "flush" call pause 100
next 'next wait
sub proj x, y, z, w xx = x yy = y*cos(t) - w*sin(t) zz = z ww = y*sin(t) + w*cos(t)
xx = 3*xx/(3 - ww) yy = 3*yy/(3 - ww) zz = 3*zz/(3 - ww)
xxx = xx*cos(t) - zz*sin(t) zzz = xx*sin(t) + zz*cos(t) xx = xxx zz = zzz
a = pi/12 b = pi/3 xxx = xx*cos(a) - yy*sin(a) yyy = xx*sin(a) + yy*cos(a) xx = xxx yy = yyy
yyy = yy*cos(b) - zz*sin(b) zzz = yy*sin(b) + zz*cos(b) yy = yyy zz = zzz
xx = 300*xx yy = 300*yy zz = 300*zz
p = sw2 + xx*d/(yy + z0) q = sh2 - zz*d/(yy + z0) end sub
sub quit Hdl$ close #Hdl$ end end sub
sub pause mil tt=time$("ms")+mil while time$("ms")<tt scan wend end sub
|
|
|
Post by tsh73 on Nov 8, 2022 10:38:38 GMT
I am deeply impressed. I just went around showing this (and the bird drawing) showing collegues the power of BASIC
|
|
|
Post by tenochtitlanuk on Nov 9, 2022 9:42:05 GMT
Yes, very impressive.
And I like your tag line- I value the world I've been lucky enough to live in for 76 years, and value the fun I've had in programming.
|
|