Results 1 to 3 of 3

Thread: Need Suggestions

  1. #1

    Thread Starter
    Join Date
    Jan 2008

    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?
    Last edited by jmsrickland; Dec 5th, 2013 at 08:06 PM.

    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    Join Date
    Jul 2006
    Maldon, Essex. UK

    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. #3
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Right Coast

    Re: Need Suggestions


    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.


Posting Permissions

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


Click Here to Expand Forum to Full Width