You're so considerate of the lcd. Most people wouldn't think twice about leaving it happy, most people just order her around.

Hehe, mainly because ionFastCopy relies on the driver being in x-increment mode

Quote:

Now would I be correct in assuming that the lens effect is a BIG table...

Yes... 2048 bytes. I only just remembered that it was 32*32*2 (I forgot that there were two bytes per element - x and y). That's pretty outrageous, seeing as the lens could be reduced to a quarter of the size by flipping it around 90 degrees... Even bit-packing (the range only goes up to 31) would drop that to 1280 - and if quartering the dimensions of the table, would only need one nybble per element - so, a 256 byte table - but seeing as this is a sort of run-once program (this is not the sort of thing with much replay value) I wasn't too fussed about the binary size at the end. (And if that's not a run-on sentence, I don't know what is). I need to fix the typos (Maxcoderz -> MaxCoderz), so maybe I'll have a shot at reducing the sizes of the lookup. RLE compression on the flipcard graphics might also be nice, but Brass didn't support that when I wrote it.

Just one thought : I wish your demos had a kind of 'storyline'. I mean, this one is - on this side - far better than Pixel Madness since it has a transition effect, but in the end it's still a few effects packed together. In other words, I'm impressed by the technical stuff (even if it's 'basic' trig =)), but as a whole it ends up as a tech show, nothing more imo. tr1p's lcbhaa was nicer from this point of view.

The lens effect is a very good example of a load-time generated distortion map, since you can change the behavior and various dimensions anytime to fool the audience that it's realtime

Pseudo-approach which I wrote off the top of my head:
Let's say you're on "(x, y) -> (r, t)" in the lens ('x' and 'y' are cart. coords, 'r' and 't' are polar). For a convex lens with the flat side down and the convex side being a spherical shell covering 90 degrees, the surface normal points with angle "an = r * pi/4" (direction pointing away from the center of the lens). The thickness of the lens, with sharp edges, is "h = cos(an) - 1/sqrt(2)". Refraction gives "n1*sin(a1) = n2*sin(a2)" which in this case can be written as "ar = an - asin(sin(an)/1.5)" where 'ar' is the angle against the vertical. Radial displacement due to trip the rays make through the lens gives "dr = h*tan(ar)". Refraction in the flat bottom can be skipped since the background is most probably touching the lens directly. Multiply 'dr' with (x, y) and you got the distortion for one point.

Since lens effects were declared as being cool and Ben had a rather "anticlimactic" way of solving it, I thought I'd just bring up the details for the interested There are of course simpler ways (like setting radial displacement as "dr = scale*r"...), but "true" simulations can be fun.

EDIT: Is it just me, or do people stop posting whenever I try to start some weirdo discussions involving maths/physics in programming?

Last edited by coelurus on Wed 15 Feb, 2006 10:04 pm, edited 1 time in total.

Just one thought : I wish your demos had a kind of 'storyline'. I mean, this one is - on this side - far better than Pixel Madness since it has a transition effect, but in the end it's still a few effects packed together. In other words, I'm impressed by the technical stuff (even if it's 'basic' trig =)), but as a whole it ends up as a tech show, nothing more imo. tr1p's lcbhaa was nicer from this point of view.

Take it as constructive criticism !

maybe he should make a game with it or a standalone game intro like Final Fantasy 1.189 (with animations of course). Also I was wondering if those kind of special effects could be used as magic animations in BASIC and ASM rpgs *cough*new xLIB feature?*cough*

Joined: Fri 17 Dec, 2004 5:33 pmPosts: 790Location: On the dark side of the moon.

coelurus wrote:

The lens effect is a very good example of a load-time generated distortion map, since you can change the behavior and various dimensions anytime to fool the audience that it's realtime

Pseudo-approach which I wrote off the top of my head:Let's say you're on "(x, y) -> (r, t)" in the lens ('x' and 'y' are cart. coords, 'r' and 't' are polar). For a convex lens with the flat side down and the convex side being a spherical shell covering 90 degrees, the surface normal points with angle "an = r * pi/4" (direction pointing away from the center of the lens). The thickness of the lens, with sharp edges, is "h = cos(an) - 1/sqrt(2)". Refraction gives "n1*sin(a1) = n2*sin(a2)" which in this case can be written as "ar = an - asin(sin(an)/1.5)" where 'ar' is the angle against the vertical. Radial displacement due to trip the rays make through the lens gives "dr = h*tan(ar)". Refraction in the flat bottom can be skipped since the background is most probably touching the lens directly. Multiply 'dr' with (x, y) and you got the distortion for one point.

Since lens effects were declared as being cool and Ben had a rather "anticlimactic" way of solving it, I thought I'd just bring up the details for the interested There are of course simpler ways (like setting radial displacement as "dr = scale*r"...), but "true" simulations can be fun.

EDIT: Is it just me, or do people stop posting whenever I try to start some weirdo discussions involving maths/physics in programming?

Nope it's not you, it is in fact true

_________________"They say that sea was created by a man named Maarten Zwartbol, a long time ago...." - Duck, an old Corbin version

Oh, but I hope that's not reason enough to abandon a thread? These threads are the most viable regarding realtime calc programming, so start discussing something else that's relevant (not "could somebody make a game out of this?"). I'm happy as long as threads like this one are active, knowing that this forum is used to further calc tech, not just for chit-chat.

I wouldn't even mind a bit if my ramblings were totally ignored as if they had never been there

HOLY SHIT! Dude, that was...I mean, how the...what on the...ben, you need to...well...make something more out of these...because it seems like a travesty something so beatiful would be JUST a tech demo.

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum