﻿ Latest contributions of: ZippyDee
24 May, 2013, 03:30:46
 OmnomIRC You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

 Show Contributions Pages: [1] 2 3 4
 1 General Discussion / Math and Science / Three intersecting parabolas on: 04 May, 2012, 02:01:19 I've been thinking about this all day and I can't figure it out...Say you have three known points p0, p1, and p2. Each of these points serves as the focus of a parabola, and all three parabolas share a single line at y=d as their directrix. Assume that d is such that all three parabolas open in the same direction, and assume that the three foci do NOT all lie on a single line parallel to the directrix.So the idea is to solve for value of d that makes all three parabolas intersect at a single point. There should only be one value that makes this true.Basically, so far I've got quite a bit conceptually figured out in terms of what needs to happen...but I don't really know how to make it happen.Here's kinda what I have:The intersection point(s) of two parabolas (zn)can be calculated fairly easily:z0=a0x2+b0x+c0z1=a1x2+b1x+c1Find the quadratic equation that is the difference of the two, and set it equal to zero:0=(a0-a1)x2+(b0-b1)x+(c0-c1)Use the quadratic formula to find the zeros:x=(-(b0-b1)±√((b0-b1)2-4(a0-a1)(c0-c1)))/2(a0-a1)A parabola can also be written as (x-h)2=4p(y-k), where (h,k) is the vertex of the parabola, (h,k+p) is the focus, and the directrix lies at y=k-pWith a focal point F and a directrix at y=d, all other necessary variables can be calculated as follows:p=(Fy-d)/2h=Fxk=Fy-pa=1/4pb=-h/2pc=h2/4p+kThrough this, all variables can be simplified down to only use F and d:a=1/2(Fy-d)b=-Fx/(Fy-d)c=Fx2/2(Fy-d)+Fy-(Fy-d)/2[/tt]So you could technically write out the equation of a parabola asy = x2/2(Fy-d)   +   -Fxx/(Fy-d)   +   Fx2/2(Fy-d)+Fy-(Fy-d)/2As you can see, it gets pretty hectic pretty quickly. For example, the quadratic formula would then be:x=(Fx/(Fy-d)±√((-Fx/(Fy-d))2-(2/(Fy-d))(Fx2/2(Fy-d)+Fy-(Fy-d)/2)))/(1/(Fy-d))Remember, this needs to be solving for d...Really, I don't know where to go from here. Anyone have any insight?---EDIT:Okay, so I'm slowly figuring things out.The equation is crazy complex, but you have to solve for the intercepts of two parabolas, then plug that quadratic formula calculation in for X in one of those equations, and set it equal to the equation for the third parabola with the quadratic formula calculation plugged in for X as well.a2((-(b0-b1)±√((b0-b1)2-4(a0-a1)(c0-c1)))/2(a0-a1))2+b2((-(b0-b1)±√((b0-b1)2-4(a0-a1)(c0-c1)))/2(a0-a1))+c2=a0((-(b0-b1)±√((b0-b1)2-4(a0-a1)(c0-c1)))/2(a0-a1))2+b0((-(b0-b1)±√((b0-b1)2-4(a0-a1)(c0-c1)))/2(a0-a1))+c0Looks like fun, right? Now substitute the As, Bs, and Cs with their F/d equivalents that I mentioned earlier, accounting for the fact that the Fs have to be Fnx and Fny for each variable of the corresponding n value.
 2 Calculator Community / The Axe Parser Project / [Axiom] Advanced Graphics [in development] on: 27 February, 2012, 23:02:50 This has been in the works for a few weeks now, so I thought I'd make a thread about it.I began writing this Axiom with a fixed-memory flood fill routine, but I failed miserably. I finally convinced jacobly to give it a try. Together we completely optimized the algorithm and he was able to write an awesomely optimized version. Then I started working on a filled circle algorithm, which jacobly volunteered to convert to Axiom format for me, but a few *cough* bugs were found. He has since been working with me to fix those bugs. All-in-all, this is basically an Axiom by both jacobly and myself.This Axiom will be a collection of more advanced graphics routines which we hope will be greatly useful for graphics programs, and potentially games as well. Some of the routines will definitely NOT be useful for games, due to speed issues.Currently written:Fixed-Memory Flood Fill (needs optimization)"Fixed-memory" means there is no risk for stack overflow AT ALL. However, the routine is subsequently very slow, so it will not be suitable for games or anything that needs fast dynamic area filling. It would be fine for a "paint bucket" tool in most on-calc graphics programs though. This will *hopefully* support grayscale filling as well.Filled Circles (aaalmost done)Fully clipped filled circle routine with variable buffer and variable fill type (on/off/invert) using numerical arguments.Kinda sorta planned:Vertical/Horizontal Line Segments (on/off/invert)Clipped Lines (on/off/invert)Rectangles (on/off/invert)Rectangle outlines (on/off/invert)Ellipses?Any other suggestions for what this axiom could have?
3  General Discussion / Computer Projects and Ideas / Fixed-Memory Flood Fill Pseudocode on: 10 February, 2012, 09:56:04
So, I was trying to write an assembly program to execute a fixed-memory flood fill routine as described by the "flood fill" Wikipedia article here, but I realized that the algorithm written there is poorly explained, and also missing a lot of crucial conditions.

After realizing this, I opened up Adobe Flash to try to write an implementation so that I could easily see what was going on at all times, and could therefore debug it a lot more easily.

After hours of debugging and modifications, I finally was able to write an algorithm that actually worked in all situations. Here is the pseudocode I have written out for it:

 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 RULE is "right"FINDLOOP is falseBOTTLENECK is falseCUR is the current pixelMARK is the first mark, and is not setMARK2 is the second mark, and is not setmain loop: if CUR is bound by 4 edge pixels paint CUR all possible pixels have been filled, so exit the routine  if CUR is bound by 3 edge pixels paint CUR move based on RULE continue main loop if CUR is bound by 2 edge pixels if the two bounding edge pixels are not across from each other, and the corner opposite both edge pixels is not filled paint CUR move according to RULE continue main loop else if RULE is "right" and  MARK is not set set MARK to CUR's location and direction set FINDLOOP to false else, if MARK is set if MARK2 is not set if CUR is at MARK's location if CUR's direction is the same as MARK's remove MARK set RULE to "right" else set RULE to "left" set CUR to MARK's direction set FINDLOOP to false else, if FINDLOOP is true set MARK2 to CUR's location and direction else if CUR is at MARK's location set CUR to MARK2's direction and location remove MARK remove MARK2 set RULE to "right" else if CUR is at MARK2's location set MARK to MARK2's direction and location set CUR's direction to MARK2's direction remove MARK2 if RULE is "right" and MARK is not set if BOTTLENECK is false paint CUR set BOTTLENECK to false move according to RULE continue main loop if CUR is bound by 1 edge pixel if RULE is "left" and FINDLOOP is false set FINDLOOP to true else, if neither  of the corners opposite the bounding pixel are filled paint CUR move according to RULE continue main loop if CUR is bound by 0 edge pixels if RULE is "left" and FINDLOOP is false set FINDLOOP to true set BOTTLENECK to false move any direction (use a default direction, not a random one) continue main loop##############################how to move according to RULE: if CUR is filled or the rule-side-corner is filled move CUR one step forward else if MARK is at the pixel one step forward set BOTTLENECK to true else, if MARK2 is at the pixel one step forward set MARK to MARK2's direction and location set CUR's direction to MARK2's direction remove MARK2 if RULE is "left" and FINDLOOP is false if either the pixel two steps forward is filled or the non-rule-side pixel is filled set FINDLOOP to true move CUR one step forward move CUR one step to the RULE side##############################every time you paint: remove MARK, if set remove MARK2, if set set FINDLOOP to false set BOTTLENECK to false set RULE to "right"

I'd like to put this into the Wikipedia article so that people can have a much better example to base their code on. Is there any way I should modify this pseudocode to make it look better?

I am also going to create some images explaining what some things are (like what an "open corner" is, as opposed to a "closed corner").

Also, if someone wants to write an ASM implementation of this, please go ahead. I bet your implementation would be better than mine >.<
4  Calculator Community / ASM Language / Fixed-Memory Flood Fill debugging on: 08 February, 2012, 10:39:36
For a while now I've been thinking about writing a fixed-memory flood fill routine. I finally wrote one out....but it doesn't work. I'm not very good at using the wabbitemu debugger, so debugging this is turning into an incredibly difficult job for me. I was wondering if someone could help me look through this and see if they can't assist me in figuring out what's wrong. I can try to clarify any questions you have in any parts of the routines.

Note that this is mostly optimized for speed because of the inevitably slow speed of this flood fill method.

EDIT: I attached a screenshot of what it does right now if you just execute it.

EDIT2: I made some modifications to the routine, but it's still buggy. The screenshot is not entirely accurate anymore. Now is' basically doing the same thing, only to the right of pxl(10,10) rather than to the left of it...

EDIT3: Updated the explanation of how the "right hand rule" should be followed at the bottom of my pseudocode. It should make more sense now...

I wrote this routine based off of the fixed memory flood fill routine loosely described here:
http://en.wikipedia.org/wiki/Flood_fill#Fixed_memory_method_.28right-hand_fill_method.29

I first wrote up this pseudocode:
 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 This algorithm:http://en.wikipedia.org/wiki/Flood_fill#Fixed_memory_method_.28right-hand_fill_method.29RULE = rightMARK = nullMARKDIR = nullFINDPASSAGE = false-----if 4 bounds painted        paint cur        stopelse if 3 bounds painted        MARK = null        FINDPASSAGE = false        RULE = right        paint cur        move to open bound        //#######################    else if 2 bounds painted        if MARK == null && RULE == right                MARK = cur                MARKDIR = dir                FINDPASSAGE = false        else if cur == MARK                if dir == MARKDIR                        MARK = null                else                        RULE = left    //.....this stuff here is the "oh no I'm in a loop" stuff.                        dir = MARKDIR                        MARK = null                        FINDPASSAGE = false                                if MARK == null && RULE == right                paint cur        move based on RULE         //after moving                                                //set "dir" to the next direction                                                //according to RULE (right hand rule or left hand rule)//######################                else if 1 bound painted        if RULE == left  //then we're in a loop, and this triggers the second stage                FINDPASSAGE = true        else                if both opposite corners are open && MARK == null                        paint cur        move base on RULEelse if 0 bounds painted        if RULE == left                FINDPASSAGE = true        paint cur?        move anywhere :P        ========================================   How do you follow the right hand rule? Which is next?           (Key: _ = empty pixel, # = filled pixel, 0 = current position and direction)if the corner is filled, just move forward        ___        _0_        _##...becomes...        ___        __0        _##but if the corner is empty, there are two possible ways to move        ___        _0_        _#_first possibility        ___        _#0        If the current pixel is painted before moving, move here        _#_second possibility        ___        ___        if the pixel is NOT painted before moving, move around the corner to the next edge        _#0        because just going straight would make it now have no borders...

Based on that I wrote my assembly program, which is quite messy, I'm sorry to say...

 7 General Discussion / Miscellaneous Discussion / HUGALOPES! on: 30 December, 2011, 12:34:22 Hello, everyone. A friend of mine is trying to get some attention for his Kickstarter project, and I thought I'd bring it to this wonderful community.All I can really say is that it would be absolutely wonderful if you guys could spread this around. Other than that I'll let their Kickstarter video speak for itself, but please visit the Kickstarter page as well (link at the bottom).http://www.youtube.com/watch?v=f_5WA5lFyp0Please read and see more here:http://www.kickstarter.com/projects/1475020745/meet-the-hugalopes-the-future-of-fluffy-fluffy-fun
 8 General Discussion / Computer Java Programming Help / QuadDouble precision on: 14 December, 2011, 01:59:47 I'm working on a project in which I'd like to use some very high precision numbers, but I want to avoid using Apfloat as much as possible because of its slow speed. After looking around I found a DoubleDouble class, which is written to act as (almost) a Quad precision wrapper using two doubles. It has 106 bits of precision instead of the 113 bits that a real Quad data type would have, but that's fine for me.But I'm still looking for something with even more precision if possible. I'm wondering how I might have a QuadDouble precision class using 4 doubles for precision, instead of only two. Does anyone know if something of this precision already exists, or how I would go about writing a QuadDouble class if it doesn't already?
 9 General Discussion / Math and Science / Dividing a map into sections - Help! on: 01 September, 2011, 01:27:04 I'm working on some pathfinding, and I've been trying to find a good way to divide a map up into sections to use as nodes for high-level pathfinding.Low-level pathing consists of generating the intricate paths required to navigate around obstacles to get to a specified end point, whereas high-level pathing is used to plan out the general route across the map that the low-level path should more or less follow (or at least gravitate toward). High-level pathfinding will ignore small obstacles (like trees or small rocks) and instead focus on finding a general route around any large areas of high ground or large masses of water, or any other major terrain aspects.Another thing that high-level pathfinding should take into account is any major choke points in the map that could be avoided. This can fairly easily be done by simply adding a higher cost for traveling from one node to another if there's a tight choke point in between the two.The actual pathfinding is fairly simple to do. The part I'm running into trouble with is creating the high-level nodes in the first place. Basically I've demonstrated what I'm trying to do on the Xel'Naga Caverns map from StarCraft 2 just as an example:-Red lines show the actual map walls (ehh, so I scribbled them in...close enough).-Blue lines show where the different sections were divided.-Green dots show the section center points that will act as the actual high-level nodes.To demonstrate how these would be used, let's say you want to find a path from the pink dot to the yellow dot. First you generate a high-level path (blue) from the high-level node of the starting section to the high-level node of the ending section. Then you'll generate the actual low-level path (white) using the high-level path as merely a guide for generally where to go.I'm trying to figure out a way to generate these map sections dynamically, but I'm really not sure how to go about doing it. Any suggestions?I'm thinking it would work to maybe trace an outline of all the walls and then simplify those outlines to smooth out the chaotic edges and find more of the general shape of the walls, and then use those angles to create the sections, but I'm not sure how to go about simplifying the lines.EDIT: I found two algorithms that I may be able to use for this: the Ramer-Douglas-Peucker algorithm for simplifying a curve made up of line segments, and the Hertel-Mehlhorn algorithm for approximate convex polygon partitioning.I can use the first algorithm to simplify the walls of the map, then use the second algorithm to remove inessential edges, leaving me with larger convex areas which I can easily use as the nodes.The only thing I still have yet to really find is a good polygon triangulation algorithm that doesn't tend to make slivers...I know  Delaunay Triangulation is supposed to avoid long, thin triangles, but I haven't found a very good explanation of the algorithm itself, or any clear implementations of it.
 10 General Discussion / Miscellaneous Discussion / Phrase Bulimic on: 31 August, 2011, 18:56:03 Just a poem I found that really captured me. Thought I'd share.Phrase Bulimicby Kathleen BurkeHello, my name is ___, andI am a phrase bulimic.A language rearranger.Do not proofread your thoughts.Language-The real life sustainer-Tastes better coming up than it does going downSautee your words in songOr scramble them with screamsBut let them come; feast on them.They are delicious.Delight in their delicious, delectable,BrutalFury.Relish-SavorAnger and love.Taste how one is a spice to maskThe sweet of the other.Devour verbsFight adverbs fervently for theirLack of commitmentAnd win.Write right.Bite poems savagely and let their juiceDribble off your chin onto yourPreying hands.Make a preposition salsa or a predicate salad,And top it off with fattening adjectives.Let the salsa, salsa, and the tangy orange tango.Write it all down.This smorgasbord is the soup of SocietyIs CivilizationAnd it rages as your soul licks the bowl clean.Crave soul food.In this world of pity, anorexia, starvation-Never go hungry.
 11 General Discussion / Computer Projects and Ideas / RTS-style Coordinated Unit Movement on: 31 August, 2011, 02:30:47 I wasn't sure exactly where to put this, but I found some great explanations of concepts and implementation of Coordinated Unit Movement for RTS-style games, though it could be used for any type of game, I suppose. I just thought some people might find this interesting and/or helpful for current or future projects.Explanation of basic concepts:http://www.gamasutra.com/view/feature/3313/coordinated_unit_movement.phpExplanation of implementation:http://www.gamasutra.com/view/feature/3314/implementing_coordinated_movement.php
 12 General Discussion / Music Showcase / An old song I wrote... on: 05 August, 2011, 02:34:00 Here's a song I wrote and recorded quite a while ago. It's called "Rickrolled." Guess what it's about.The quality sucks, the singing is bad, but whatever. It was fun to write. http://soupinabox.com/rickrolled.mp3
 13 General Discussion / Miscellaneous Discussion / Actors/Actresses on: 03 August, 2011, 07:20:07 Have any favorites?For actresses, at least, I like Natalie Portman a lot. Not just because she's very attractive, but because she's also a fantastic actress, and she's very intelligent.Spoiler for image: Another actress who is also really good and very smart (and looks a lot like Natalie Portman) is Olivia Wilde.Spoiler for image: Shout-outs also to Emma Stone...Spoiler for image: ...and, of course, Emma Watson (who DEFINITELY looked better with long hair).Spoiler for image: For actors, I really appreciate Robin Williams for his inhumanly fast comedic brainpower, and his incredible use of characters and character quirks/eccentricity.Spoiler for image: I also really like James Franco. He's a very truthful actor, and I really respect that about him.Spoiler for image: Another incredibly truthful method-actor that I greatly admire is (or was) Heath Ledger.Spoiler for image: These are only a few of my favorites. What are yours?
 14 General Discussion / Miscellaneous Discussion / Baryshnikov and Nureyev on: 11 July, 2011, 13:53:52 As you may or may not know, I am quite involved in dance. I recently received a full scholarship to a ballet studio, and I am taking full advantage of that, dancing at least 10 hours a week there, and at least 4 hours a week at another studio as well.Anyway, being that I am so engaged in ballet lately, I have been watching videos of Mikhail Baryshnikov and Rudolph Nureyev, quite possibly the two best male ballet dancers (ballerinos) in the history of forever.Rudolph Nureyev dancing Corsaire with Margot Fonteyne (who is also amazing):http://www.youtube.com/watch?v=BiIst40or60Mikhail Baryshnikov also dancing Corsaire (though he does only the male variation, a.k.a. the male solo):http://www.youtube.com/watch?v=rlPZSAURSb8Obviously on a personal level I am floored by these performances, as was the rest of the classical ballet community. Nobody had ever seen anything like either of these men. It really helps to know what exactly it is that you're looking at, and to have some understanding of how the moves are executed, so being an actual dancer helps, but they're still pretty amazing to watch. I mean, seriously...HOW THE HELL DOES ANYONE EVER JUMP AS HIGH AS NUREYEV?? (see around 3:20 or so) And those incredible turns in both performances...how do you ever keep your balance like that? It's like they're all superhuman!Oh well...I am aware that many of you may not appreciate this nearly as much as I, but I wish to expand the world's view of dance, especially the concept and acceptance of male dancers. These men were phenomenal, the best there ever was. I hope you can at least appreciate these a little bit.
 15 Omnimaga / OmnomIRC and SpyBot45 development / PM's disappear on: 11 July, 2011, 08:31:26 When you get a query in Omnom it displays the message in the current window with (PM) next to the name. It also opens up a new query window in the channel bar...But the query window seems to not log any messages. If switch channels and then switch back, all queries are lost forever in the dark abyss that is deleted data.
 Pages: [1] 2 3 4