Thread: point to point

  1. #1
    Registered User
    Join Date
    May 2007
    Location
    regina
    Posts
    2

    Smile point to point

    I have a program which will have small rectangles following a line or path from point A to point B. Does anyone have a snippet of code that will figure this out along the way from A to B or B to A. They will be painted every 20 milliseconds and increase i pixel length or more so i have to know what the next MIDpoint is.
    Thanks
    robarm4

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Draw it out on paper, and figure out the geometry.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2007
    Location
    regina
    Posts
    2
    Ya i have tried to do that many times but i am bad a geomatry. I Will have many lines randomly produced so It will be different every time. Just need a working formula i guess
    robarm4

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Game programming is going to get hard in a hurry if you're not comfortable with 2D and 3D geometry.

    Maybe get some maths text books (or http://mathworld.wolfram.com/topics/Geometry.html)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying a binary tree.
    By nempo in forum C++ Programming
    Replies: 3
    Last Post: 04-14-2008, 09:44 PM
  2. Help realy needed
    By ZohebN in forum C++ Programming
    Replies: 2
    Last Post: 04-08-2008, 09:37 AM
  3. Getting a floating point exception
    By SnertyStan in forum C Programming
    Replies: 13
    Last Post: 03-25-2008, 11:00 AM
  4. How to monitor process creation?
    By markiz in forum Windows Programming
    Replies: 31
    Last Post: 03-17-2008, 02:39 PM
  5. floating point binary program, need help
    By ph34r me in forum C Programming
    Replies: 4
    Last Post: 11-10-2004, 07:10 AM