point to point

This is a discussion on point to point within the Game Programming forums, part of the General Programming Boards category; I have a program which will have small rectangles following a line or path from point A to point B. ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,767
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,767
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 10:44 PM
  2. Help realy needed
    By ZohebN in forum C++ Programming
    Replies: 2
    Last Post: 04-08-2008, 10:37 AM
  3. Getting a floating point exception
    By SnertyStan in forum C Programming
    Replies: 13
    Last Post: 03-25-2008, 12:00 PM
  4. How to monitor process creation?
    By markiz in forum Windows Programming
    Replies: 31
    Last Post: 03-17-2008, 03: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21