[Papervision3D] Problems with culling
xero
xero.nu at gmail.com
Fri Nov 2 06:26:38 PDT 2007
>
> Zeh Fernando said:The best thing to do is to get rid of the additional
> (unneeded) surfaces altogether, as you suggested.
agreed.
i would use the new Cube and use your images as only
the front and rear faces, and the others like a colormaterial
or a diffrent texture suited to the face size...
here's some Andre code!
[code]
// create a materials
var material1:ColorMaterial = new ColorMaterial(0xFF0000);
var material2:BitmapMaterial = new BitmapMaterial(...);
// create the material list for the cube
var materiallist:MaterialsList = new MaterialsList();
materiallist.addMaterial(material1,"top");
materiallist.addMaterial(material1,"bottom");
materiallist.addMaterial(material2,"front");
materiallist.addMaterial(material2,"back");
materiallist.addMaterial(material1,"left");
materiallist.addMaterial(material1,"right");
// create cube
var cube:Cube = new Cube( materiallist, 128, 128, 128, 2, 2, 2);
[/code]
digit.
____ ___
\ \/ /___________ ____
.\ // __ \_ __ \/ _ \
./ \ ___/| | \( <_> )
/___/\ \___ >__|---\____/
| \_/ \/ |
| xero harrison |
| x at xero.nu |
| http://xero.nu |
| http://fontvir.us |
| http://xero.owns.us |
`---------------------'
> ---------- Forwarded message ----------
> From: Zeh Fernando <zehfernando at zeh.com.br>
> To: papervision3d at osflash.org
> Date: Fri, 02 Nov 2007 11:08:03 -0300
> Subject: Re: [Papervision3D] Problems with culling
> Since you actually have two surfaces for each side, you're having some
> z-fighting because they're too close to each other. This is more of a
> problem in PV3D, as calculating the z-depth has some additional lack of
> precision for speed.
>
> http://en.wikipedia.org/wiki/Z-fighting
>
> The best thing to do is to get rid of the additional (unneeded) surfaces
> altogether, as you suggested.
>
>
> Zeh
>
> Lewis Evans wrote:
> > Lo all,
> >
> > I'm putting together a carousel of photos of our team.
> >
> > I've made boxes and applied a photo to each and then I'm putting planes
> > on the left, right and eventually top and bottom of the boxes to form
> sides.
> >
> > I'm aware I should construct the front and back pictures as planes and
> > hence make a box entirely out of planes for the final piece. This is a
> > work in progress.
> >
> > What I want to know is why the side planes have a culling problem. They
> > are both 1px in front of the image box.
> >
> > This is a curiosity for me – I like to know why things happen…
> >
> > Link:
> >
> > http://twentysixleeds.com/lewis/album.html
> >
> > [code]
> >
> > var caros:DisplayObject3D = new DisplayObject3D();
> >
> > var numOfPics = 10;
> >
> > var numDegrees = 360/numOfPics
> >
> > for (var i=1; i<numOfPics+1; i++) {
> >
> > var obj:DisplayObject3D = new DisplayObject3D();
> >
> > var bam:BitmapAssetMaterial = new BitmapAssetMaterial("photo"+i);
> >
> > var sides:ColorMaterial = new ColorMaterial(0xFFFFFF, 100);
> >
> > var angle:Number;
> >
> > var xPos:Number;
> >
> > var zPos:Number;
> >
> > //
> >
> > var radions = (numDegrees*i)*(Math.PI/180);
> >
> > //
> >
> > xPos = Math.sin(radions);
> >
> > zPos = Math.cos(radions);
> >
> > angle = Math.atan2(xPos, zPos);// in radians
> >
> > angle = Math.round(angle/Math.PI*180);// convert to degrees
> >
> > //bam.doubleSided = true;
> >
> > var c:Cube = new Cube(bam, 20, 100, 100, 2, 2);
> >
> > var side_left:Plane = new Plane(sides, 20, 100, 2, 2);
> >
> > side_left.x =51;
> >
> > side_left.rotationY = -90;
> >
> > //
> >
> > var side_right:Plane = new Plane(sides, 20, 100, 2, 2);
> >
> > side_right.x =-51;
> >
> > side_right.rotationY = 90;
> >
> > //
> >
> > obj.addChild(side_left);
> >
> > obj.addChild(side_right);
> >
> > obj.addChild(c);
> >
> > obj.x = xPos*250;
> >
> > obj.z = zPos*250;
> >
> > obj.rotationY = angle;
> >
> > caros.addChild(obj);
> >
> > }
> >
> > //p.rotationZ = 90;
> >
> > //scene.addChild(mast);
> >
> > scene.addChild(caros);
> >
> > [/code]
> >
> > Thank you muchly
> >
> > Lewis Evans
> > *Flash developer*
> >
> > * *
> >
> > *twentysix*
> > LEEDS
> > 3 Sovereign Place, Leeds LS1 4SP
> > T. +44 (0)113 234 2022
> > M. +44 (0)7966 097 975
> > F. +44 (0)113 247 0265
> > www.twentysixleeds.com <http://www.twentysixleeds.com/>
> >
> > WINNER @ MIPTV @ Milia 2006 International Content 360: WEB 2.0 Next
> > Generation Collaborative Web Concepts.
> > FINALIST @ MIPTV @ Milia 2007 International Content 360: On Demand
> > Participation.
> >
> > yda winner
> >
> > design week
> >
> > Twentysix London Limited trading as twentysix Leeds, registered in
> > England, registered number 03178478, registered office Clarence Mill,
> > Clarence Road, Bollington, Cheshire, SK10 5JZ.
> > Media Square plc or any of its subsidiary companies may not be held
> > responsible for the content of this email as it may reflect the personal
> > view of the sender and not that of the company. Should you receive this
> > email in error, please notify the sender immediately and do not disclose
> > copy or distribute it. While Media Square plc runs anti-virus software
> > on all servers and all workstations, it cannot be held responsible for
> > any infected files that you may receive. Media Square plc advises all
> > recipients to virus scan any file attachments.
> >
> >
> > ______________________________________________________________________
> > This email has been scanned by the MessageLabs Email Security System.
> > For more information please visit http://www.messagelabs.com/email
> > ______________________________________________________________________
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071102/a25d4255/attachment.html
More information about the Papervision3D
mailing list