Well anyway it is good this way to.

Thank you guys for the help

Bogdan

]]>Thank i'll play with it and let you know

Bogdan

]]>So, you would draw the smaller ball in the background, then in front of it you would draw the connecting bar, but the bar has to start at the correct spot [ie (x+f*r*cos a,y+f*r*sin a)], then draw the bigger ball on top.

In this case **f** would be about 0.7, all you have to do is estimate **f**. I would start by looking at the relative sizes of the balls and also how far apart they are.

Note: **f** would be 1 when the balls are the same size. It would also be 0 when the balls are on top of each other. Just play with it until it looks good.

Right now there isn't any variable but it can be made but i dind't understand what you mean by foreground/background angle between the spheres sory

Bogdan

]]>But if you want to add a bit more realism, it may work to simply estimate the point.

Mathsyperson showed you how to find the point on the edge of the circle, why not bring that point back a little towards the centre of the circle.

So your modified co-ordinates of (p,q) would be (x+**f***r*cos a,y+**f***r*sin a), where **f** is your "fudge factor" (something less than 1).

**f** should vary according to the foreground/background angle between the spheres, hopefully you have some variable in your program that can be used as the basis for **f**

Can't hurt to try ...

]]>Bogdan

]]>It is not tested yet but i hope it will work

Bogdan

]]>```
__
/ . \
| |
\ __ /
```

And then how to draw the 2D ellipse that would result from the projection of the circle where the tube joins the sphere ... and then how to clip that ... aaaarrhggg.

]]>I could watch that animation for ages!

And once you got tired of that, you could start playing with it!

]]>yes that makes sense, i'll see if that will do the thing. And thanks

@ MathsIsFun

actualy it is 2D becuase flash(swish in this case) doesn't support 3D and the 3D is faked here by making the z coordinate in function by x and y.

The initial planes were for them to be tubes but that means not to change this problem. And when i say tubes i mean a rectangle with gradient fill.

Thanks guys for the replys

Bogdan

]]>Your question is in 2D, but your problem is in 3D. Are the connecting rectangles going to end up as tubes?

]]>Secondly, I think all you need to do is drop a perpendicular from (p,q) down to the horizontal line, forming a right-angle triangle with a hypotenuse of r and angle of a. You can find the other 2 lengths of this triangle with trigonometry and to get your co-ordinates you would add these values to x and y.

So, the horizontal length would be r*cos a, meaning p is x+r*cos a and the vertical length is r*sin a, meaning q is y+r*sin a.

So, your co-ordinates of (p,q) are (x+r*cos a,y+r*sin a)

Oh, and your 3d move thing is very nice

]]>I have a problem with finding the coridnates of a point.

To see better this is what i'm working on this http://www.swish-db.com/staff/bogdan/files/3dmove.html in flash. The lines connecting should not go from the back of the one on top to the "back" of the one on the bottom.

So someone suggested me to find the point where the line hits the surface.

I made this drawing while trying to find it:

So basicaly i know the center x and y, i know the radius and angle and i need to calculte points A x and y.

Thank you very much

Bogdan

]]>