That's not what I suggested...

by (Login Mikrondel)
R

Forget paths, forget vanishing points. The solution to this problem does NOT require sin/cos.


This is the main task:
Given the location of a star (as x, y, and z co-ordinates), find where it should appear on the screen (as p, q co-ordinates). Don't worry about the movement of the stars (yet). Just make sure that wherever the star is at one moment, its location on the screen is correct.

There is a bit of difficult 3D visualisation involved. This program may help you:

SCREEN 12
LOCATE 14, 3: PRINT "Eye";
LOCATE 12, 9: PRINT "Screen";
LOCATE 10, 49: PRINT "Star";
LINE (30, 240)-STEP(400, 0), 4
CIRCLE (30, 240), 3
LINE (90, 200)-STEP(0, 80)

LINE (90, 229)-(400, 170), 2
LINE (400, 240)-(400, 170), 2

LINE (30, 240)-(90, 229), 9
LINE (90, 240)-(90, 229), 9


PSET (400, 169)
PSET (401, 170)
PSET (399, 170)
PSET (400, 171)

END

Think of it as a side-view of the situation (with no perspective). This means that the Y axis points upwards and the Z axis points to the right. The X axis points towards you.

You should be able to find lines in the diagram that have the lengths p, x, and z. You also know the distance from the eye to the screen, so you should be able to calculate p based on x and z, using similar triangles.

Repeat the process except treat the diagram as a top view this time.

See how you go.

Posted on Mar 15, 2009, 7:08 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
Can't say that I understand what you mean:Ben on Mar 15, 8:27 PM
 Do you understand what the diagram is showing? on Mar 15, 9:48 PM
  REBen on Mar 16, 11:34 AM
   Actually... on Mar 16, 3:46 PM
    Correct?Ben on Mar 23, 1:19 PM
     * RESUME WHAT? You already tried to END it. on Mar 23, 2:30 PM
     Wait... sorry..Ben on Mar 23, 3:45 PM
      *Good job! on Mar 23, 3:56 PM
       * How far is the eye from the monitor?Ben on Mar 25, 1:33 PM
        Just pick something that looks realistic on Mar 25, 2:46 PM
     Getting a lot better! on Mar 23, 3:51 PM