-
-
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?
-
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 ?
++
-
Nobody can help me ?
I'm sure you can
-
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 > -1 ) {
var p1 = vt[ vi ];
if ( vi == 0 ) {
var p2 = vt[vt.length - 1];
} else {
var p2 = vt[ vi - 1 ];
}
if ( p1.ty >= 0 || p2.ty >= 0 ) {
if ( p2.ty < 0 ) {
var dy = p1.ty - p2.ty;
polyClip.push ( p1 );
polyClip.push ( { tx: p1.tx - ( p1.tx - p2.tx ) / dy * p1.ty, ty: 0, tz: p1.tz - ( p1.tz - p2.tz ) / dy * p1.ty } );
} else if ( p1.ty < 0 ) {
var dy = p2.ty - p1.ty;
polyClip.push ( { tx: p2.tx - ( p2.tx - p1.tx ) / dy * p2.ty, ty: 0, tz: p2.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 :)
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|