# Thread: Need Suggestions

1. ## Need Suggestions

I'm working on a 3D games that has white and black colored balls. Player will mouse down on a ball and while he holds the mouse down he can move the ball and the object is to get the ball from it's stationary position to one of many poles that appear on a 3D matrix, like some poles appear to be very close to the player and others appear to be far away in the distance.

What I would to do is as the ball(s) move to the back and to the front show them as different sizes progressively getting either smaller (as they move towards the back) and progressively getting larger as they move towards the front.

Right now I see two problems:

1) How to make the balls progressively smaller/larger as they move

2) How to determine if they are moving towards the back or front. If user mouse down on a ball and move it how do I know he is moving it, let's say, to the back as opposed to just horizontal or vertical. What could tell me this?

2. ## Re: Need Suggestions

Perhaps a bit simplistic, but it may give you some ideas....

1. Presumably you have a routine that will draw a Sphere, that being the case, then altering the radius will alter the size of the Sphere. If you're using an image as the Sphere isn't it just a matter of zooming in / out?

2. Moving up and down will change the Mouse position's Y value only. Moving left and right will change the Mouse position's X value only. Moving to the back and front will change both X and Y values. By examining the X and Y values in a mousemove and comparing them to the values of the mousedown / previous mousemove should give you the direction of motion.

3. ## Re: Need Suggestions

JMS

Regarding towards front or back .. let's call this the Z-axis

It seems that you have a pre-defined set of targets .. the "poles"
Further, I would imagine that you have 3 coords for each pole .. x, y, z

If you know the z axis coord of the ball, then you ought to be able to determine
whether movement wiill be towards front or back.

Spoo

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured

Click Here to Expand Forum to Full Width