Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

3D Graphics: sort faces? / clipping? / prevent warping from rotation?

ShkaboinkaShkaboinka Member Posts: 79
I have my own interface for 3D Graphics and 3D objects/mechanics (using Java, but that is NOT relevant); I am having trouble knowing how to sort the faces/polygons in order of drawing (I have no problem with wire-frame!). whats the algorithm?
what about clipping/bounding (I know WHAT it is)?
what about keeping a constant set of coordinates and reforming figures from the original to prevent warping (I don't know how to keep track of rotation)?

I have a really great setup for manipulating wireframe stuff:
each "widget" has rotation & translation procedures/modules, and array of 3D points, array of lines (referencing cells in the point array), array of curves (same deal), and array of inner widgets that behave as part of the "root" widget but can be manipulated separately. Any questions or suggestions?

(I figured nearly ALL of this myself; it's much easier than you'd think!)

Comments

  • Vorsin S.V.Vorsin S.V. Member Posts: 25
    [b][red]This message was edited by Vorsin S.V. at 2003-8-27 4:50:6[/red][/b][hr]
    [b][red]This message was edited by Vorsin S.V. at 2003-8-27 4:49:35[/red][/b][hr]
    [b][red]This message was edited by Vorsin S.V. at 2003-8-27 4:49:6[/red][/b][hr]
    [b][red]This message was edited by Vorsin S.V. at 2003-8-27 4:48:37[/red][/b][hr]
    [b][red]This message was edited by Vorsin S.V. at 2003-8-27 4:48:2[/red][/b][hr]
    : I have my own interface for 3D Graphics and 3D objects/mechanics (using Java, but that is NOT relevant); I am having trouble knowing how to sort the faces/polygons in order of drawing (I have no problem with wire-frame!). whats the algorithm?
    : what about clipping/bounding (I know WHAT it is)?
    : what about keeping a constant set of coordinates and reforming figures from the original to prevent warping (I don't know how to keep track of rotation)?
    :
    : I have a really great setup for manipulating wireframe stuff:
    : each "widget" has rotation & translation procedures/modules, and array of 3D points, array of lines (referencing cells in the point array), array of curves (same deal), and array of inner widgets that behave as part of the "root" widget but can be manipulated separately. Any questions or suggestions?
    :
    : (I figured nearly ALL of this myself; it's much easier than you'd think!)
    :

    Back to front face drawing:
    "Painter" algorithm. Works with an uncrossed faces.
    ===========
    1. First you need to make a quick sort.

    1.1. Sort the faces from back to front using their vertices Z value (far vertex (maximum Z from 3 vertices) from face is compared to another vertex (maximum Z) of another face. (this is to be sorted in the render list).

    For instance:______0
    ________________------------
    ________________
    ______________________/
    _________________2___/
    ____________________ /
    ____________________/1



    and list will contain (2,0,1) (All polygons are visible, faced to camera)

    ============
    2. Next, stage is order correction:


    2.05. for (N=0; NProject->Replace->).

    If you need a clipping algorithm description, post a message.











  • ShkaboinkaShkaboinka Member Posts: 79
    No, that's NOT it! have you ever noticed a phenomenon called PERSPECTIVE? something can be farther back, but in front of another plane if it is off to the side. Your algorithm will only work for RAYCASTING (where you draw a scaled 2D image at the 3D point).

    |
    | |
    | | The face on the far left is something like
    | |: {(-5,5,2),(-5,5,5),(-5,-5,5),(-5,-5,2)}, yet it is behind
    | |: | the other which has a further back max Z than
    | |: | {(-4,4,2),(-4,4,7),(-4,-4,7),(-4,-4,2)}
    | |: |
    | |: |
    | |: /
    | | /
    | /|/
    |/
Sign In or Register to comment.