Retrieving the perpendicular angle from an arc

ok… I’m working on the pinball game. I need to come up with a way of retreiving the right angle from an curved line.
The idea is to have the ball follow a curve around the upper border of the game field. The ball itself is going to be a point, which the ball follows, so that I can use the shape of the object when doing hit detection. I’m not sure if that’s relivant to the subject or not… but it gives some idea of where I’m going with this.

I’m open for suggestions.

Howdy…

I guess Kitiara will love it when the game is done… :wink:

Anyways… I found a couple of things that might help you to please her… :stuck_out_tongue:

Gravity Ball by FlashGuru
Billiard Ball Physics at FlashKitHope to see a good game… :wink:

thanks… I’ll look into these.

not anything I haven’t accomplished already… but thanks cyanblue. :slight_smile:

I’ll let you know if I find something else… :wink:

haha… I TOLD YOU… you’re going to need to know the equation for the curve…

maybe if you draw it in actionscript, kinda like lost’s besier curve thing on his site, you can figure out the equation from there…

but in order to get the normal, you need to find out the tangent of the curve…

BUT to make a pinball game, you don’t NEED to do a curve… have you played the altoids one? I think they ran into that same problem too, and decide to do away with curved surfaces

I’m not sure if it’s worth doing without the curve lavaboy. :slight_smile:

ok well, if you want an irregular curve, you’re going to end up using calculus, no matter what…

however, if you want to use the inside edge of a circle as a curve, there are some tricks I can think about… I’ll write them when I get home

I’d be more than happy to hear them.

I was also thinking the same thing as you… that ploting out the points in a list or arrray, which coincide with the actual curve… might be the way to go. I’m not quite ready to go to that extreme yet… but maybe soon. :stuck_out_tongue:

well… lets think about how we might have calculated this in pre-newtonian times…

if you have an irregular curve, you could have some hidden straight lines, like 4 or 5, that follow the contour of the curve. You would definitely be able to set the angular response to those… and the ball would simulate to a degree the path it would take along that curve.

I dont think you need to go as far as the pixel on this.

http://flash-france.com/fla.php?op=viewfilm&film_id=318

And you can also check all the fla’s from Alcys, he’s incredibly talented. Tell me if you need a translation :stuck_out_tongue:

WOW…

that’s all I have to say.
and yes… I need a translation

Yeah I need a translation as well. That’s exactly the math I’m looking for.

I think what that FLA is doing is determining where in the contour the ball hits, and hten checking where the coordinates of the surrounding pixels are… then it determines the normal from there…

but I dont think you need to go into that much detail… I think if you’re doing an irregular surface (not as irregular as the ones in the example) you should be ok with 4 or 5 invisible lines…

ehh… I’m not so sure about that. In the case of a pinball… we want it to run up a vertical and then bend as it reaches the arc. That’s not going to be accomplished by invisible lines.

I’ll make up an example later on on what I’m talking about…

I drew a simple picture in photoshop, so that you can see what I’m talking about… this is my solution to the curve problem

Well, Alcys did post an explanation on my french board. I’ll try to translate his explanation late tonight. :slight_smile:

thanks! I’m really interested as to how it works.

But David, you also have to think about this… the ball is only going to pass through that area less than 5% of the time (by my estimate…) is a behavior that requires so many hit tests per area necessary?

well the ball really only has one behavior. And probebly there will never be more than 5 balls in play no matter what game you make. I don’t think that the hit tests will be nearly as slugging to the system as you think they are going to be.

and how may hit tests. It’s one per ball, per frame… and possibly only every other frame. Am I thinking about that incorrectly?