Page **2** of **2**

### Re: 3D square using sin/cos ?

Posted: **Mon Aug 27, 2018 9:22 pm**

by **sandord**

It's funny how the two shifted squares give the illusion of 3D, never looked at it that way.

Are looking for doing 'real' 3D? And what is TML?

### Re: 3D square using sin/cos ?

Posted: **Mon Aug 27, 2018 9:37 pm**

by **exxos**

sandord wrote: ↑Mon Aug 27, 2018 9:22 pm

It's funny how the two shifted squares give the illusion of 3D, never looked at it that way.

Yeah, only way my simple mind can think of doing it

sandord wrote: ↑Mon Aug 27, 2018 9:22 pm

Are looking for doing 'real' 3D?

Wasn't really a aim to anything, just trying to do some cool 3D'ish stuff in STOS. I may add the cube as a test in GB6 one day...

I think what demo coders do with the 3D square which then blends into a hex type shape is cool... I guess if I drew the hex shapes at size 0, it would give the appearance of the square as you see it now.. but larger scale the corners become hex shapes... to complicated for me

sandord wrote: ↑Mon Aug 27, 2018 9:22 pm

And what is TML?

TML = The Missing Link.. using it for faster screen clear..

New code calculates 1000 moves and stores them in a array now.

### Re: 3D square using sin/cos ?

Posted: **Tue Sep 11, 2018 11:11 pm**

by **miggymog**

My bad attempt at Random 3d shapes from the 90's.

Code: Select all

```
10 key off : curs off : hide on : click off : mode 1 : auto back off : update off : mouseoff
20 mode 0
30 rem
40 rem
50 palette 0,$111,$222,$333,$444,$555,$666,$777,$770
60 set stars 100,1,0,0,319,199,0,7
1000 rem ********************************************************
1001 ink 8
1005 SCREEN_WIDTH=128 : HALF_SCREEN_WIDTH=SCREEN_WIDTH/2
1007 SCREEN_HEIGHT=128 : HALF_SCREEN_HEIGHT=SCREEN_HEIGHT/2
1009 dim SX(720),SY(720),SZ#(720)
1010 for CALC_SINUS=0 to 359
1020 SX(CNT)=sin(rad(CALC_SINUS))*HALF_SCREEN_WIDTH+159
1030 SY(CNT)=cos(rad(CALC_SINUS))*HALF_SCREEN_HEIGHT+99
1050 SZ#(CNT)=1.0/((((sin(rad(CALC_SINUS)*2)+cos(rad(CALC_SINUS))/2)*20+20)/SCREEN_WIDTH)+1.0)
1051 SX(CNT+360)=SX(CNT)
1052 SY(CNT+360)=SY(CNT)
1053 SZ#(CNT+360)=SZ#(CNT)
1060 inc CNT
1080 doke $FF8240,not(deek($FF8240)) : next CALC_SINUS
10000 rem***************************************
10005 logic=back : SIDS=rnd(20)+1 : SIDCAL=360/SIDS : if SIDCAL mod 2<>0 then goto 10005
10006 for XCV=0 to 100
10010 for CNT=0 to 359 step SIDCAL
10011 TMP=(CNT2 mod 360)
10012 TMP2=(CNT3 mod 360)
10020 X=SX(CNT+TMP)*SZ#(TMP2+44) : Y=SY(CNT+TMP)*SZ#(TMP2+44)
10030 X2=X*SZ#(TMP2)+XXX
10035 Y2=Y*SZ#(TMP2)+YYY
10036 draw X,Y to OX,OY
10037 draw X2,Y2 to OX2,OY2
10040 draw X,Y to X2,Y2 : OX=X : OY=Y : OX2=X2 : OY2=Y2
10042 inc CNT2 : inc CNT3
10050 next CNT
10060 screen swap : wait vbl : wipe logic : go stars 1,0,physic : : next XCV : goto 10005
```

### Re: 3D square using sin/cos ?

Posted: **Tue Sep 11, 2018 11:24 pm**

by **exxos**

miggymog wrote: ↑Tue Sep 11, 2018 11:11 pm

My bad attempt at Random 3d shapes from the 90's.

I removed the stars and mouse off bit, would that break it (just being lazy in finding the extensions) though it flashes the screen white really fast then says "for without next" on the last line

### Re: 3D square using sin/cos ?

Posted: **Tue Sep 11, 2018 11:29 pm**

by **exxos**

ah nevermind, the last line did not import into STOS...

looks pretty cool, bit out on one part, but still cool

- Blank_00026.png (1.49 KiB) Viewed 1400 times

### Re: 3D square using sin/cos ?

Posted: **Wed Sep 12, 2018 9:25 am**

by **Smonson**

I tried to run some of these listings tonight, but I couldn't figure out how to type some of the keystrokes in Hatari

### Re: 3D square using sin/cos ?

Posted: **Fri Sep 14, 2018 7:45 pm**

by **miggymog**

The extension stuff just speeds it up a bit. I really should fix it to join the start and end up