A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: 3D clipping

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    17

    3D clipping

    Hello

    I'm actually working on a 3D engine, and today I need to implement the clipping of faces. But in fact I don't understand how to do it
    I didn't find a lot of courses on the internet talking about it.
    So if someone has a good link, or can explain it to me, it would be great

    thanks , kiroukou

  2. #2
    Junior Member
    Join Date
    Dec 2000
    Location
    the netherlands
    Posts
    29
    I don't know exactly what you want to do,
    but I can give you these two links:

    http://www.macromedia.com/devnet/mx/.../flash_3d.html
    http://www.macromedia.com/devnet/mx/...d_classes.html

    The first link is also in a post in this forum ... did you search?

  3. #3
    Junior Member
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    17
    Hello
    Yes I know those links And I performed a search before making this post.

    My problem is very precise, and I need some explanation of the technique of clipping.

    Here is an example of my engine : http://pagesperso.laposte.net/kiroukou/camera2/
    As you can see there's a problem sometimes.

    Is there anybody who knows clipping technique ?
    ++

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    17
    Nobody can help me ?
    I'm sure you can

  5. #5
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    hi thomas :o)

    moving to the english zone ?

    Try to get something out of this script:
    PHP Code:
        //-- polygon clipping

        
    var polyClip = [];

        var 
    vi vt.length;    // vt = vertices from polygon (x,y,z)

        
    while ( --vi > -) {

            var 
    p1 vtvi ];

            if ( 
    vi == ) {

                var 
    p2 vt[vt.length 1];

            } else {

                var 
    p2 vtvi ];

            }

            if ( 
    p1.ty >= || p2.ty >= ) {

                if ( 
    p2.ty ) {

                    var 
    dy p1.ty p2.ty;

                    
    polyClip.push p1 );
                    
    polyClip.push ( { txp1.tx - ( p1.tx p2.tx ) / dy p1.tyty0tzp1.tz - ( p1.tz  p2.tz  ) / dy p1.ty } );

                } else if ( 
    p1.ty ) {

                    var 
    dy p2.ty p1.ty;

                    
    polyClip.push ( { txp2.tx - ( p2.tx p1.tx ) / dy p2.tyty0tzp2.tz - ( p2.tz  p1.tz  ) / dy p2.ty } );
                    
    polyClip.push p2 );

                } else {

                    
    polyClip.push p1 );
                    
    polyClip.push p2 );

                }

            }

        } 
    I have no short example here right now, but you will get it :)

  6. #6
    Junior Member
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    17
    Hello Andre
    AndreMichelle said
    moving to the english zone ?
    Yes I have to, english speaker are more obliging

    I have no short example here right now, but you will get it
    Yes I understand it
    Thank you for your help, I will try it right after my short hollyday

    Danke
    ++

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