October 31, 2020, 09:41:41 AM

## News:

subscribe to codewalrus

You can help CodeWalrus stay online by donating here.

## CKH4's 3D plane program

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

0 Members and 1 Guest are viewing this topic.

#### DJ Omnimaga

##### April 22, 2015, 01:28:12 PM #15
Oh ok. I'll try to post the code later. Also I should try doing something with your avatar background.

#### CKH4

##### April 22, 2015, 02:48:30 PM #16 Last Edit: April 22, 2015, 02:55:01 PM by CKH4
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

#### Snektron

##### April 22, 2015, 03:03:44 PM #17
wow, thats actually quite useful. Though i still miss some matrices
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### CKH4

##### April 22, 2015, 03:08:00 PM #18
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.

#### DJ Omnimaga

##### April 22, 2015, 04:22:41 PM #19 Last Edit: April 23, 2015, 12:00:27 AM by DJ Omnimaga
Ooh that could be useful if it's really more user-friendly.

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

`EXPORT plane3D()BEGINDIMGROB_P(G1,320,240,#9EAB88);0▶A;WHILE 1 DOA-π*(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;`

#### CKH4

##### April 23, 2015, 02:17:41 AM #20
Cube!!! Aweful perspective but that's what I get for faking stuff.

#### DJ Omnimaga

##### April 23, 2015, 03:20:37 AM #21
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 . 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.

#### Snektron

##### April 23, 2015, 07:25:45 AM #22
What do you guys mean with "raycasting", i mean i though raycasting was more for picking objects and such, not rendering.
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### Duke "Tape" Eiyeron

##### April 23, 2015, 07:35:25 AM #23
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.

#### Snektron

##### April 23, 2015, 07:42:31 AM #24
Seems like a pretty heavy rendering method. Then again, so are raytracing and raymarching
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### Duke "Tape" Eiyeron

##### April 23, 2015, 08:11:03 AM #25
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.

#### Snektron

##### April 23, 2015, 08:32:26 AM #26
But its still heavier than rasterizing, right?
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### Duke "Tape" Eiyeron

##### April 23, 2015, 08:37:23 AM #27
No, it's faster, else it wouldn't exist.

#### Snektron

##### April 23, 2015, 08:39:31 AM #28
Oh thats interesting... But it has to have some drawbacks, else we wouldnt use rasterizing?
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### Duke "Tape" Eiyeron

##### April 23, 2015, 11:00:04 AM #29
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.