[General Algorithme] 3D engines

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

That is why I will leave what I have and I ask others to do the same.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

It doesn't seem to make much of a difference. I gave my crappy old code to some people back then, and they didn't do anything with it. Which doesn't surprise me, because it would've been more work to try to understand that piece of crap than to rewrite the thing from scratch, which those people weren't capable of at the time :) That's usually how things go with assembly, it's easier to rewrite the entire thing than to work with old code that isn't structured the way you want/need it. I've even had that with my own projects several times.

Besides, I usually intend to get back to my projects and I don't want to give it all away while I'm working on it... Of course in the long run I usually don't get back to it, but you get my point.
how well would building a flat buffer to represent a ~120 degree FOV, and use a lookup table to distort it all at the same time? Not exactly sure how one would program that, or if it would even be more efficient than what you are doing, though.
I don't think I understand what you're saying, could you please repeat that for a foreigner with no clue about image manipulation and 3D rendering? ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Well one could always look over code and learn.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Timendus wrote:
how well would building a flat buffer to represent a ~120 degree FOV, and use a lookup table to distort it all at the same time? Not exactly sure how one would program that, or if it would even be more efficient than what you are doing, though.
I don't think I understand what you're saying, could you please repeat that for a foreigner with no clue about image manipulation and 3D rendering? ;)
I believe he refering to a method to make it look like you can rotate you direction smoothly, to have it appear this is true 3d. Something like a reverse fishbowl... I don't think it'd be hard to implement, though I have no idea what it would look like.

How many buffers need to be merged? if it were just three I'd say do it in the wasted clocks cycles of the lcd code. being grayscale that could make things tougher.

Now if you buy a real calculator like 84+SE, you raycast grayscale no problem.
Image
User avatar
Fr0stbyte124
Regular Member
Posts: 75
Joined: Thu 16 Feb, 2006 9:59 pm

Post by Fr0stbyte124 »

I fail to see how your fancy USB and external clock put you above the rest of us. :lol:

But reverse fishbowling is basically what I meant. It might be too slow, though, because of all the bit shifting that would be involved. On the other hand, since it would be exactly the same effect throughout the simulation, it is theoretically somewhat plausable that one could make a massive lookup table and super efficient routine that could map it within an interrupt cycle.

I've just started on graphics, so I don't know what would work best on an 8 bit platform. The lack of multiplication would certainly make things unpleasant. Maybe raycasting is best.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Its cause of the speed increase (15MHz).

Also im not sure that a reverse fishbowl would look very good ... still its worth a shot i suppose.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

Hmm, I don't see how the inverse fish-bowl algo works. What's gonna be distorted?

There are loads of muls in raycasting, each ray needs atleast 2 muls iirc. When a secret is opening up, there are 4 per column.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

I think they were talking about reverse fishbowling a pre-rendered 2D image?

How nice would it be if the z80 (in our calcs) had MUL and DIV instructions :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Ah, I understand now. I was thinking about something like that, but only to make rotations look more smooth. In some demo Ben wrote he slides the front image from the screen to the side to replace it with the image of the new direction you're looking in, so it looks a bit like you're rotating. I do indeed intend to try to improve that with a reversed fishbowl like effect, though I'm not sure it'll be fast enough in greyscale for enough frames to make it look good.

I've ditched the idea of OR-ing images, I now build the screen with several vertical images next to each other. Going through a LUT and comparing with the map determines which vertical image has to be shown in which column. It works alright, and it's pretty fast even with greyscale.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
yhean
New Member
Posts: 3
Joined: Sun 19 Feb, 2006 9:56 am

Post by yhean »

CoBB wrote:
Stickmanofdoom wrote:It seems to me that the most practical way to get a 3d engine for z80 calcs would be to get many community members involved in different parts of an engine.
No! Why do so many people get the idea that adding more coders improves development? It's rather the opposite.
Herm... I was precisely about to evoke the hypothetical possibility to gather certain interesting aspects of "3D-engines" attempts for the z80, and finally get something usable. Doesn't seem to be a good idea.

:?
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

This is what I got so far:
Image
I'm sorry about the noise, that's what RGP and PTI come up with.

It's actually too fast now, as you may be able to see it detects more keypresses than I intend to give it several times :) But that won't be a problem, I still have a few things that I have to code that'll slow this down, like the animated rotation. I'm not going for the fishbowl after all, because I realized that my images don't fit onto each other so it'll only look ugly. I'll try "Ben style" screen sliding instead :)

I also still need to mask the top and bottom edges of the slanted walls, so they don't overwrite the background (the background image holds the roof, the floor and the pointless "status screen"). Though I kinda like the smooth grey surfaces, so I'm not sure if that's still neccessary :)

Anyway, I think this is pretty much as 3D as you'll be able to get when you want to use greyscale. Unless you pre-render everything, but then you wouldn't be staying under 5000 bytes without compression like this thingy does ;)
Last edited by Timendus on Fri 04 Apr, 2008 9:52 am, edited 1 time in total.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
CDI
Maxcoderz Staff
Posts: 321
Joined: Tue 24 May, 2005 7:25 pm
Location: If I find out, you'll be first to know.
Contact:

Post by CDI »

*ZOMG! passes out*
ImageImage
User avatar
Fr0stbyte124
Regular Member
Posts: 75
Joined: Thu 16 Feb, 2006 9:59 pm

Post by Fr0stbyte124 »

It looking great. If you want to do rotaions with that, I think probably raycasting is the way to go.

James Montelongo made a raycasted grayscale program some time back, so it's certainly possible.
http://www.ticalc.org/archives/files/fi ... 36011.html
I haven't been able to find his source. It's not hosted on his website anymore.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

James Montelongo made a raycasted grayscale program some time back, so it's certainly possible.
http://www.ticalc.org/archives/files/fi ... 36011.html
Wow, Jim, that's pretty damn fast :o Is it really that fast, or did you spice up the gif? :mrgreen:
I mean... I know you're a damned brilliant coder, but this is faster than the b/w z80 raycasters...

*watches the screenshot once more*
Can I marry your brain? :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

Can I marry your brain?
Dude, if people were allowed to marry Jim E's brain, it'd be the most eligble bachelor this side of... <witty closing remark>
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Post Reply