A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: how to make Flash to to draw behind the user

  1. #1
    Member
    Join Date
    Dec 2001
    Posts
    32

    how to make Flash to to draw behind the user

    I am working on a 3d map a prototype of which can be seen here.
    The problem I am having becomes obvious as soon as you hit the link. The map will appear quite messaed up due to the fact that it is initially positioned quite far down the "z" axis. Hold UP arrow and it will take shape as it moves forward.

    All of it is drawn using lineTo() and curveTo().

    A user will be able to travel around the map, so I need to somehow stop calculations on those parts of the map that get quite behind the user when the camera moves frorward to stop them from getting twisted and messing up the view.

    I am new to 3D and have mostly been relying on the tutorial published bu Senocular at Kirupa.com. Most of the examples there, however, are about the objects that take no or very little space along "z" axis. So one can just stop any calculations on those objects when they go behind the user. If I was to do that, the lines drawn to the points that go below the threshold (focalLength) from the points that are still visible will start being drawn to weird places.

    What would you do in this case? Any advice from people with 3D experience will be greatly appreciated.

    Thanks a lot.

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    bleh
    Posts
    276
    hi iggy
    i think the problem is that you have gone past the z value of
    -focalLength...
    once you go beyond -focalLength, z goes the other way...
    sorta like going inside out on itself...
    how to fix it ?
    depends on how you have your engine set up..
    dont let it go beyond "-f"

    if( z <= -f){ z = -f}

    steve

  3. #3
    Member
    Join Date
    Dec 2001
    Posts
    32

    how to make Flash not to draw behind the user

    hi steve,
    thanks for your reply. I have tried to do it the way you suggested:

    if( z <= -f){ z = -f}

    but to avoid distorting the lines I would also have to recalculate "x" values, so that they are the same as when the line first crossed -focalLength. Something like:

    if( z <= -f){ z = -f; x = someValueFromBefore;}

    Otherwise, if "z" is the same and "x" is not, the angle at which a line is drawn is gonna start changing. And I can't think of a straightforward way to recalculate "x".
    Last edited by iggyV; 03-25-2004 at 09:08 AM.

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

HTML5 Development Center