[ / / / / / / / / / / / / / ] [ dir / random / erp / fa / girltalk / htg / mu / tech / tingles / x ][Options][ watchlist ]

/tech/ - Technology

Freedom Isn't Free
You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 42ace08b51ce025⋯.jpg (319.51 KB, 1294x859, 1294:859, 20210518_225334a.JPG) (h) (u)

File (hide): ef58ed9d9bae772⋯.jpg (630.7 KB, 1080x1080, 1:1, 20210518_225334e.JPG) (h) (u)

File (hide): 299a958feb0c4d6⋯.jpg (375.88 KB, 1409x920, 1409:920, 20210518_225416.JPG) (h) (u)

[–]

 No.1086640[Watch Thread][Show All Posts]

As my gift to all Anons, here's my 'hello world' in graphics programming.

#define N 10
int charge[N], xc[N], yc[N];

{
for (int i = 0; i < N; i++)
{
charge[i] = -50 + random() % 100;
xc[i] = random() % 320;
yc[i] = random() % 240;
}

Address_set (0, 0, 239, 319);
for (int x = 0; x < 320; x++)
{
for (int y = 0; y < 240; y++)
{
int ch = 1023;
for (int i = 0; i < N; i++)
{
int dx = x - xc[i];
int dy = y - yc[i];
ch += charge[i] * sqrtf(dx*dx + dy*dy);
}
Lcd_Write_Data16 ((unsigned short)ch);
}
}

delay (5000);
}

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.


[Return][Go to top][Catalog][Screencap][Nerve Center][Random][Update] ( Scroll to new posts) ( Auto) 5
0 replies | 0 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / random / erp / fa / girltalk / htg / mu / tech / tingles / x ][ watchlist ]