
If you want to do some Poker game,
you may want to know how to use two different Material in one plane,
You need to download this Class below
and import that class...
DoubleSidedCompositeMater.as
//=========================================== /** * copy right By http://www.nabble.com/attachment/16002163/0/DoubleSidedCompositeMater... * * fix to Papervision3D ActionScript 3.0 Library .ZIP rev 839 * http://papervision3d.googlecode.com/files/Papervision3D_rev839.zip * * Mark in 2008.12.28 By tenchiwang * */ package fly.papervision3D.materials.special { import flash.display.BitmapData; import flash.display.Graphics; import flash.geom.Matrix; import org.papervision3d.core.render.command.RenderTriangle; // import org.papervision3d.core.geom.renderables.Triangle3D; import org.papervision3d.core.geom.renderables.Vertex3DInstance; import org.papervision3d.core.material.TriangleMaterial; import org.papervision3d.core.proto.MaterialObject3D; import org.papervision3d.core.render.data.RenderSessionData; import org.papervision3d.core.render.draw.ITriangleDrawer; public class DoubleSidedCompositeMaterial extends TriangleMaterial implements ITriangleDrawer { protected var materials:Array; public function DoubleSidedCompositeMaterial(){ _initialize(); } ; private function _initialize():void { materials = new Array(); } ; public function addMaterial(material:MaterialObject3D):void { materials.push(material); } ; public function removeMaterial(material:MaterialObject3D):void { materials.splice(materials.indexOf(material), 1); } ; public function removeAllMaterials(material:MaterialObject3D):void { materials.splice(0); } ; override public function drawTriangle(face3D:RenderTriangle, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData = null, altUV:Matrix = null):void { var vertex0:Vertex3DInstance; var vertex1:Vertex3DInstance; var vertex2:Vertex3DInstance; var x0:Number; var y0:Number; var x1:Number; var y1:Number; var x2:Number; var y2:Number; var draw:Boolean; var material:MaterialObject3D; for each (material in materials){ draw = true; // vertex0 = face3D.v0.Vertex3DInstance(); // vertex1 = face3D.v1.Vertex3DInstance(); // vertex2 = face3D.v2.Vertex3DInstance(); vertex0 = face3D.v0.clone(); vertex1 = face3D.v1.clone(); vertex2 = face3D.v2.clone(); x0 = vertex0.x; y0 = vertex0.y; x1 = vertex1.x; y1 = vertex1.y; x2 = vertex2.x; y2 = vertex2.y; if (material.opposite){ if ((x2 - x0) * (y1 - y0) - (y2 - y0) * (x1 - x0) > 0){ draw = false; } ; } else { if ((x2 - x0) * (y1 - y0) - (y2 - y0) * (x1 - x0) < 0){ draw = false; } ; } ; if (draw){ material.drawTriangle(face3D, graphics, renderSessionData); } ; } ; } ; } ;This is the sample file code:
package { import flash.display.*; import flash.events.*; import org.papervision3d.materials.BitmapAssetMaterial; import org.papervision3d.materials.BitmapFileMaterial; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.cameras.Camera3D; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.scenes.Scene3D; import org.papervision3d.view.Viewport3D; import org.papervision3d.objects.DisplayObject3D; import fly.papervision3D.materials.special.DoubleSidedCompositeMaterial; public class card extends MovieClip { private var scene:Scene3D; private var viewport:Viewport3D; private var camera:Camera3D; private var renderer:BasicRenderEngine; private var plane:Plane; public function card():void { viewport = new Viewport3D(550, 400, true, false); this.addChild(viewport); renderer = new BasicRenderEngine(); camera = new Camera3D(); scene = new Scene3D(); initObject(); this.addEventListener(Event.ENTER_FRAME, onEventRender3D); } private function initObject():void { var CardMat1:BitmapAssetMaterial = new BitmapAssetMaterial("Card1", true); var backMat:BitmapAssetMaterial = new BitmapAssetMaterial("CardBack", true); backMat.precise = true; backMat.opposite = true; //Let the other side of the material reverse var _doubleMaterial:DoubleSidedCompositeMaterial = new DoubleSidedCompositeMaterial(); _doubleMaterial.addMaterial(CardMat1); _doubleMaterial.addMaterial(backMat); _doubleMaterial.doubleSided = true; plane = new Plane(_doubleMaterial, 225, 400); scene.addChild(plane); } private function onEventRender3D(e:Event):void { plane.rotationY += 3 renderer.renderScene(scene, camera, viewport); } } }
Woot, that's brilliant, pv3d needed this kind of possibilities !
ReplyDeleteSadly the file is'nt hosted. Would you host it again please ?
Sugar Bowl
ReplyDeleteSugar Bowl Live
2018 Sugar Bowl
Sugar Bowl Live Stream
Sugar Bowl 2018
Sugar Bowl 2018 Live
Watch Sugar Bowl
Allstate Sugar Bowl
Allstate Sugar Bowl 2018
Alabama vs Clemson
Clemson vs Alabama
Sugar Bowl 2018
Sugar Bowl 2018 Live
Sugar Bowl 2018 Live Stream
Golden Globes
ReplyDeleteGolden Globes 2018
Golden Globes 2018 Live
Golden Globe
Golden Globe 2018
Golden Globe Award
Golden Globe Awards 2018
Golden Globe
Golden Globe 2018
Golden Globes
Golden Globes 2018
Golden Globes 2018 Live
2018 Golden Globes
Golden Globes Award
Alabama vs Georgia
ReplyDeleteAlabama vs Georgia 2018
Alabama Georgia
Alabama vs Georgia live
Alabama vs Georgia live stream
Watch Alabama vs Georgia
Georgia vs Alabama
Georgia vs Alabama
Georgia vs Alabama 2018
Georgia Alabama
Georgia vs Alabama live
Georgia vs Alabama live stream
Watch Georgia vs Alabama
Alabama vs Georgia
ReplyDeleteAFC Championship
AFC Championship Live
AFC Championship 2018
AFC Championship Game
AFC Championship Game 2018
AFC Championship 2018 Live
AFC Championship Game Live
AFC Championship Game 2018 Live
2018 AFC Championship
NFC Championship
NFC Championship Live
NFC Championship 2018
NFC Championship Game
NFC Championship Game 2018
2018 NFC Championship
NFC Championship Live
NFC Championship 2018 Live
NFC Championship Game Live
NFC Championship Game 2018 Live
2018 NFC Championship Live
ReplyDeleteNFC Championship Game
NFC Championship Game 2018
NFC Championship Game Live
AFC Championship Game
AFC Championship Game 2018
AFC Championship Game Live
Patriots vs Jaguars
Jaguars vs Patriots
Jaguars vs Patriots
Patriots vs Jaguars
Vikings vs Eagles
Eagles vs Vikings
Eagles vs Vikings
Vikings vs Eagles
Grammys
ReplyDeleteGrammys Live
Grammys 2018
Grammys 2018 Live
Grammy 2018
2018 Grammys
Grammy Awards
Grammys
Grammys Live
Grammys 2018
Grammys Live
2018 Grammys
Grammys 2018 Live
Grammy 2018
Grammy Awards
Grammy Awards 2018
Joshua vs Parker
ReplyDeleteJoshua vs Parker Live
Joshua vs Parker Live Stream
Joshua vs Parker Fight
Joshua vs Parker Boxing
Parker vs Joshua
Parker vs Joshua Live
Joshua vs Parker
Joshua vs Parker Live
Joshua vs Parker Fight
Parker vs Joshua
Parker vs Joshua Live
The Masters
ReplyDeleteThe Masters Golf
Masters 2018
Masters Tournament
Masters 2018 Live Stream
Masters Golf
2018 Masters
Masters 2018
The Masters
The Masters Golf
Masters Tournament
Masters 2018 Live Stream
Masters Golf
2018 Masters
The Masters Live
Masters 2018
The Masters Golf
Masters Tournament
Masters 2018 Live Stream
Masters Golf
2018 Masters
The Masters Live
Masters 2018
The Masters Golf
Masters Tournament
Masters 2018 Live Stream
Masters Golf
2018 Masters
The Masters Live
The Masters
Masters 2018 Live
Masters 2018
The Masters Live
The Masters
The Masters
ReplyDeleteThe Masters Live
Masters 2018
Masters 2018 Live
Masters Golf
Masters Tournament
Masters Live
The Masters
The Masters Live
Masters 2018
Masters 2018 Live
Masters Golf
Masters Golf Live
Masters
ReplyDeleteMasters Live
Masters Live Stream
The Masters
The Masters Live
Masters 2018
Masters 2018 Live
Masters 2018 Live Stream
Masters Golf
Masters Golf Live
Masters Tournament
WrestleMania 34
ReplyDeleteWrestleMania 34 Live
WWE WrestleMania 34
WWE WrestleMania 34 Live
WrestleMania 2018
WrestleMania 2018 Live
WrestleMania 34 Live Stream
WrestleMania 34
WrestleMania 34 Live
WrestleMania 34 Live Stream
WWE WrestleMania 34
WWE WrestleMania 34 Live
WrestleMania 2018
WrestleMania 2018 Live
Higa Vs Rosales live
ReplyDeleteHiga Vs Rosales live
Higa Vs Rosales live
Higa Vs Rosales
Daigo Higa Vs Cristofer Rosales Live
Higa Vs Rosales live
Higa Vs Rosales online
watch Higa Vs Rosales 2018
watch Higa Vs Rosales online
Higa Vs Rosales live free
Higa Vs Rosales stream
Daigo Higa VS Cristofer Rosales Live
Daigo Higa VS Cristofer Rosales Live Stream
Higa Vs Rosales live streaming
Higa Vs Rosales Live Stream
Higa Vs Rosales Live
Higa Vs Rosales live
watch Higa Vs Rosales live
Higa Vs Rosales 2018 live
Higa Vs Rosales live stream HD
Higa Vs Rosales boxing Live
Higa Vs Rosales Japan
Higa Vs Rosales Japan Live
NFL Draft
ReplyDeleteNFL Draft Live
NFL Draft 2018
NFL Draft 2018 Live
2018 NFL Draft
NFL Draft
NFL Draft Live
NFL Draft 2018
NFL Draft 2018 Live
Kentucky Derby Live
ReplyDeleteKentucky Derby 2018
Kentucky Derby 2018 Live
2018 Kentucky Derby
Kentucky Derby
Kentucky Derby Live
Kentucky Derby 2018
Kentucky Derby 2018 Live
2018 Kentucky Derby
Kentucky Derby
ReplyDeleteKentucky Derby Live
Kentucky Derby 2018
Kentucky Derby 2018 Live
Kentucky Derby Horses
Kentucky Derby
GGG vs Martirosyan
GGG vs Martirosyan Live
Martirosyan vs GGG
Golovkin vs Martirosyan
Golovkin vs Martirosyan Live
Martirosyan vs Golovkin
Kentucky Derby
ReplyDeleteKentucky Derby 2018
Kentucky Derby Live
Kentucky Derby 2018 Live
2018 Kentucky Derby
Kentucky Derby
Kentucky Derby 2018
Kentucky Derby Live
Kentucky Derby 2018 Live
2018 Kentucky Derby
GGG vs Martirosyan
GGG vs Martirosyan Live
Golovkin vs Martirosyan
Martirosyan vs GGG
Kentucky Derby
ReplyDeleteKentucky Derby Live
Kentucky Derby 2018
Kentucky Derby 2018 Live
2018 Kentucky Derby
Kentucky Derby
Kentucky Derby Live
Kentucky Derby 2018
Royal Wedding Live Stream
ReplyDeleteRoyal Wedding Ceremonies online
The Royal wedding 2018
The Royal wedding 2018 Live
The Royal wedding 2018 Live stream
The Royal wedding Live stream
Royal wedding 2018 Live stream
Royal weeding Live Coverage
Royal wedding live stream free online
Royal Wedding 2018: Live Stream & Coverage
Britains Royal Wedding Live stream
Royal Wedding Ceremony Live Online
Royal Wedding Function live stream
Royal Wedding Live Coverage
royal wedding live broadcast
meghan markle prince harry marriage
royal wedding live coverage
royal wedding Tv coverage
NBA Finals
ReplyDeleteNBA Finals Live
NBA Finals 2018
NBA Finals
NBA Finals Live
NBA Finals 2018
NBA Finals
NBA Finals 2018
NBA Finals
NBA Finals 2018
ReplyDeleteNBA Finals
NBA Finals Live
NBA Finals 2018
NBA Finals 2018 Live
2018 NBA Finals
NBA Finals
NBA Finals Live
NBA Finals 2018
NBA Finals
NBA Finals Live
NBA Finals 2018
NBA Finals
NBA Finals Live
NBA Finals 2018
NBA Finals 2018 Live
NBA Draft
ReplyDeleteNBA Draft Live
NBA Draft Live Stream
NBA Draft 2018
NBA Draft 2018 Live
NBA Draft Live Free
2018 NBA Draft
Watch NBA Draft
Watch NBA Draft 2018
British Open
ReplyDeleteBritish Open 2018
British Open
British Open Golf
British Open
British Open Golf
Open Championship
Open Championship 2018
The Open Championship
Open Championship Golf
The 147th edition of the British Open begins July 19 at the Carnoustie Race Championship in Angus, Scotland
ReplyDeleteBritish Open 2018
British Open
2018 British Open
British Open Golf
British Open 2018 Live
2018 British Open
2018 Open Championship
Open Championship Live
Open Championship 2018
The Open Championship
Open Championship 2018 Live
Open Championship Live Coverage
British Open 2018
British Open
2018 British Open
British Open Golf
British Open 2018 Live
2018 British Open
2018 Open Championship
Open Championship Live
Open Championship 2018
The Open Championship
Open Championship 2018 Live
Open Championship Live Coverage
PGA Championship
ReplyDeletePGA Championship Live
PGA Championship Live Stream
PGA Championship 2018
PGA Championship Golf
PGA Championship
PGA Championship Live
PGA Championship 2018
PGA Championship Golf
2018 PGA Championship
PGA Championship
ReplyDeletePGA Championship Live
PGA Championship Live Stream
PGA Championship 2018
PGA Championship Golf
PGA Championship
PGA Championship Live
PGA Championship 2018
PGA Championship 2018 Live
2018 PGA Championship
Canelo vs GGG
ReplyDeleteCanelo vs GGG 2
Canelo vs GGG Live
GGG vs Canelo
GGG vs Canelo 2
Canelo vs Golovkin
Canelo vs Golovkin Live
Golovkin vs Canelo
Canelo vs GGG
Canelo vs GGG 2
Canelo vs GGG Live
GGG vs Canelo
Canelo vs Golovkin
Golovkin vs Canelo
Canelo vs GGG
ReplyDeleteCanelo vs GGG 2
Canelo vs GGG Live
GGG vs Canelo
GGG vs Canelo 2
Canelo vs Golovkin
Canelo vs Golovkin Live
Golovkin vs Canelo
GGG vs Canelo
GGG vs Canelo 2
GGG vs Canelo Live
Canelo vs GGG
Canelo vs Golovkin
Golovkin vs Canelo
Total Sportek
ReplyDeleteTotal Sportek Live
Total Sportek Live Stream
Total Sportek Live Streaming
Total Sportek Live Free
Total Sportek Live Online
Watch Total Sportek
Total Sportek Live Scores
TotalSportek
TotalSportek Live
Cotton Bowl
ReplyDeleteCotton Bowl Live
Cotton Bowl 2018
Cotton Bowl 2018 Live
Orange Bowl
Orange Bowl Live
Orange Bowl 2018
Peach Bowl
Peach Bowl Live
Peach Bowl 2018
Super Bowl
ReplyDeleteSuper Bowl Live
Super Bowl 2019
Super Bowl 2019 Live
2019 Super Bowl
Super Bowl 53
Super Bowl 53 Live
Super Bowl
Super Bowl Live
Super Bowl 2019
Super Bowl 2019 Live
Oscars
ReplyDeleteOscars Live
Oscars 2019
Oscars 2019 Live
91st Oscars
Academy Awards
Oscar Awards
Oscars
Oscars Live
Oscars 2019
Oscars 2019 Live
Academy Awards
Oscar Awards
GGG vs Rolls
ReplyDeleteGGG vs Rolls Live
Rolls vs GGG
Golovkin vs Rolls
Golovkin vs Rolls Live
GGG vs Rolls Fight
GGG Rolls
Belmont Stakes
Belmont Stakes Live
Belmont Stakes 2019
Belmont Stakes 2019 Live
Belmont Stakes Race
Women's World Cup
ReplyDeleteWomen's World Cup 2019
Women's World Cup Live
Women's World Cup 2019 Live
USA vs Netherlands
Netherlands vs USA
United States vs Netherlands
USA vs Netherlands Live
Netherlands vs USA Live
United States vs Netherlands Live
Copa America Final
ReplyDeleteCopa America Final Live
Copa America Final
Copa America Final Live
Copa America Final
Brazil vs Peru
CMA Awards
ReplyDeleteCMA Awards Live
CMA Awards Live Stream
CMA Awards Winners
CMA Awards 2019
CMA Awards tickets
CMA Awards voting
CMA Awards channel
CMA Awards 2018
53rd annual CMA Awards
CMA Awards 2020
watch CMA Awards
CMA country music Awards
country music Awards nashville
CMA Awards 2019 live
CMA Awards tv schedule
CMA Awards 2019 performers
CMA Awards
CMA Awards Live
CMA Awards Live Stream
CMA Awards Winners
CMA Awards 2019
CMA Awards tickets
CMA Awards voting
CMA Awards channel
CMA Awards 2018
53rd annual CMA Awards
CMA Awards 2020
watch CMA Awards
CMA country music Awards
country music Awards nashville
CMA Awards 2019 live
CMA Awards tv schedule
CMA Awards 2019 performers
Such a Great article, Keep up the good work!
ReplyDeleteHoliday Things to Do Do
Christmas in Boston 2019
Dog Lovers Christmas t shirt
Best Selling Dog T Shirts
build dog t shirt
Holiday Things to Do
Christmas in Boston 2019
2019 idea-ology christmas
Best Selling Dog T Shirts
2019 Dollywood Christmas
The US Open Tennis 2020 Live stream will be for the 140th edition of the tournament, which is set to feature many prominent names in the world of tennis.
ReplyDelete