The distance of an object.

This is a discussion on The distance of an object. within the C++ Programming forums, part of the General Programming Boards category; Say I have this object that at 1 mile away, is 100 pixles wide. How many pixles is it at ...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    The distance of an object.

    Say I have this object that at 1 mile away, is 100 pixles wide. How many pixles is it at 2 mile wide?

    I am probably asking a simple question, but I have no idea how size/distance is figured.

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,667
    I imagine you can do this the same way cartographers plot cities on a map. Just put everything to scale. This is a proportion question. Do you remember how to solve those?

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    At 2 miles, it will be 50 pixels.
    Callou collei we'll code the way
    Of prime numbers and pings!

  4. #4
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Unless my math is wrong, if you think about the "camera" being a single point, because of different ways to express the tangent of the angle,

    w1/d1 = w0/d0
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  5. #5
    Registered User
    Join Date
    May 2006
    Location
    Troy
    Posts
    14
    You don't need to worry about tangents of angles -- because computer screens are flat, you want to think about how the rays of light are laid out as they pass through a plane in front of the camera.

    w1*d1 = w0*d0 is the relationship to use.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. using this as synchronization object
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 03-22-2008, 07:49 AM
  2. circular doubly linked list help
    By gunnerz in forum C++ Programming
    Replies: 5
    Last Post: 04-28-2007, 08:38 PM
  3. Question on l-values.
    By Hulag in forum C++ Programming
    Replies: 6
    Last Post: 10-13-2005, 04:33 PM
  4. A question about constructors...
    By Wolve in forum C++ Programming
    Replies: 9
    Last Post: 05-04-2005, 04:24 PM
  5. shortest path problems
    By talz13 in forum C++ Programming
    Replies: 7
    Last Post: 05-08-2004, 06:13 AM

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