Join us on Discord!
You can help CodeWalrus stay online by donating here.

CKH4's 3D plane program

Started by CKH4, April 21, 2015, 09:35:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dream of Omnimaga

Oh ok. I'll try to post the code later. Also I should try doing something with your avatar background. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

#16
If you want the individual tiles I can get you them this weekend I think. Maybe later today but I'm not sure.

Edit. This looks cool http://www.skytopia.com/project/cube/cube.html
  • Calculators owned: TI-83+, TI-84+


Snektron

wow, thats actually quite useful. Though i still miss some matrices :P
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


CKH4

I haven't read it all the way yet but it did inspire me to try to make a cube with the engine thing that I made.
  • Calculators owned: TI-83+, TI-84+


Dream of Omnimaga

#19
Ooh that could be useful if it's really more user-friendly. :D

EDIT: @CKH4 Here's the source per your request by the way:

EXPORT plane3D()
BEGIN
DIMGROB_P(G1,320,240,#9EAB88);
0▶A;
WHILE 1 DO

A-π*(ISKEYDOWN(8))+π*(ISKEYDOWN(7))▶A;
6*COS(.05*A)▶B;
SIN(.05*A)▶C;
RECT(G1,#9EAB88);
TEXTOUT_P(−B/2+B/6*D,G1,0,0);
TEXTOUT_P(−3-D/5*C,G1,0,20);
TEXTOUT_P(11−B/2+B/6*D,G1,220,0);
TEXTOUT_P(3+D/5*C,G1,220,20);
LINE(G1,−B,6-C,B,6+C,#1A1C16);
LINE(G1,−B,C-6,B,−6-C,#1A1C16);
LINE(G1,B,6+C,B,−C-6,#1A1C16);
LINE(G1,−B,6-C,−B,C-6,#1A1C16);
FOR D FROM 0 TO 6 STEP .25 DO
// LINE(G1,−B/2+B/6*D,3+D/5*C,−B/2+B/6*D,−3-D/5*C,#1A1C16);
BLIT_P(G1,160+24*(−B/2+B/6*D),120+24*(−3-D/5*C),166+24*(−B/2+B/6*D),121+24*(D/5*C),"name",4*D,0,1+4*D,24,#A6DCFF);
BLIT_P(G1,D*4,120,1+D*4,144,"name",4*D,0,1+4*D,24,#A6DCFF);
END;
BLIT_P(G0,G1);
END;
END;

ICON name 89504E470D0A1A0A0000000D49484452000000180000003008030000003C564A91000000ED504C5445A6DCFF030303EEF0F1F6F6F6FAFAFAEAEAEBEDEFF1E3E5E7E7E7E7FFFFFFF3F4F6DCDEE13394E83191DFF2F4F60357FF0453F02986D79A9B9D2E8FE3EEEEEEAFAFAFAAADAE9B9E9F777A7E044FE3044CDB3193E8E4E4E48080808B8B8BB1B1B17B7B7B74767A6A6F7A0449D2D6D9DA7E7E7E868686A7A8A96D6D6D737373ADADADCACACA7A7A7A7F7F7FE8E8E8DFDFDFF0F0F0F8F8F8D7D7D7A8A8A8E3E3E3828282848484CECECEB7B7B7A8AAAC8989897D7D7DC3C3C5A2A2A2939393C5C5C5BEBEBEAAAAAA8383837171717676767878789E9E9E6E7071666768A7A7A76E6E6E787B7C71747776787A9B9B9B4FDB67010000004F74524E53000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002903720E0000017D494441547801EDD2DD56DA401440617680DA5414B5C5FA5386515BDA5423481BC02015249452D4F77F1CCF844948A4BDF3D259CB9BF391332B6617E20314FE75708A0E85759479A954C6719E09E537B0C15BD77D971736A96CC92DDBAEEBE4D641A5BAC36E45A4C85E46E0BDC04EB542F103B5FD54F878C0E11187D5633E51578D15E8FA099C72C667BE3495FA6A05BEE169AD05E3B9FA9EC0B94C2E3CB4AF7D3357B5042E5BB169951CBB8B769BCBAB4E067EACA0EDB633E093AECA83B6D08196FB13BF19C4772BD5B5D0939B5B5C049A6069FD6B2C983F1DA0C390819146FCAFE4469E1030BFEED7449A5D355C0ABFB8B5578CC6F83EDDE53BC2F88E4914C94366CB54335DBE23BFD56026EBFEE0F9A19AF377C642DF8BE02DEC4A78A83F9A604806996FF69F8ED6C37A0D2EDBD5CB07B7DE950DCE74C55A572DD355188A998D8D04E2AEA8F5956CD3D215C3F893F7181B1C8F948064B5EA4DB2BA8586CC355134CDF43680C95C85BE8700696F9295E863FDC11645D25B5A5BBE9927223B45CB11B69EBA0000000049454E44AE426082;
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

Cube!!! Aweful perspective but that's what I get for faking stuff.
  • Calculators owned: TI-83+, TI-84+


Dream of Omnimaga

Weird indeed lol. But I assume that can be solved somewhat easily, right? I really need to learn how to create rudimentary but more complex 3D models or maps so I can attempt at making some sort of 3D HP Prime game. Else I could just try raycasting.

One thing I had in mind was to cheat a bit and not really use true 3D for textures, but use a lower resolution to hide the display glitches :P. That could allow some super fast-paced 3D game and it would still look good per calc standards. Mode-7 is another thing I want to experiment with one day.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

What do you guys mean with "raycasting", i mean i though raycasting was more for picking objects and such, not rendering.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

Raycasting can be also used for primitive 3D projection, like Doom or Wolfenstein, with the distance of the wall you hit with a ray, you can calculate the height the wall will take on the screen and display it correctly on this pixel row. I suggest you to search on Google about 3D with raycasting.
  • Calculators owned: A lot.

Snektron

Seems like a pretty heavy rendering method. Then again, so are raytracing and raymarching :P
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

Raycasting is definitely lighter than raytracing/marching. Basic raycasting only uses one ray per screen pixel row, thus Wolfenstein 3D could be the first FPS ever on computer not powerful enough for more advanced 3D rendering techniques as DOom or Quake will allow later.
  • Calculators owned: A lot.

Snektron

But its still heavier than rasterizing, right?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

No, it's faster, else it wouldn't exist.
  • Calculators owned: A lot.

Snektron

Oh thats interesting... But it has to have some drawbacks, else we wouldnt use rasterizing?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

Yes, walls are vertical and as it's grid based, you'll have some problems adding non linear walls, but that's possible, look at Doom's map, they're bitmaps and yet you even have things like stairs.
  • Calculators owned: A lot.

Powered by EzPortal