text: START LEARNING
  FLASH NOW
  Get instant access to over
  45 minutes of FREE Flash
  tutorials on video
  and our newsletter.
  . .
  Bacface Culling entails not rendering faces on 2D models that will not be visible. They are behind other faces.
  It saves time and processing power.
  Make sure that your points are ordered clockwise in your face.
  Let's go! Type this into your actionscript panel..
  // create a movieclip
  this.createEmptyMovieClip("mc1",1);
  // make the points of a triangle
  // let z = 0 for convenience
  var p1 = new v3d(100,100,0);
  var p2 = new v3d(150, 250,0);
  var p3 = new v3d(50,350,0);
  // declare a variable for later use.
  var v1 = new v3d(0,0,0);
  // ----- STEP 1
  // get the vector going from point 1 to point 2
  // ie pt1 - pt2
  v1.x = p1.x - p2.x;
  v1.y = p1.y - p2.y;
  v1.z = p1.z - p2.z;
  // --- STEP 2
  // get the vector going from pt 2 to pt 3
  // ie pt2 - pt3
  var v2 = p2.minVecNew(p3);
  var testv = p1.minVecNew(p2);
  //
  v2.toString();
  testv.toString();
  trace(v1.x +" , "+v1.y + " , "+v1.z);
  // -------- STEP 3
  // GET normals of vectors from 1 -2 and 2-3
  // get normal = magnitude
  var mag1 = v1.getNormal();
  var mag2 = v2.getNormal();
  Flash Tutorials in Video Format -
  Watch them now at LearnFlash.com
  // -------- STEP 4
  // normalise both vectors
  // this step actually encompasses step 3
  // so step 3 is not necessary
  v1.normalize();
  v2.normalize();
  trace(v1.toString());
  // --------- STEP 5
  // get the cross products of normlised vectors
  var n1 = v1.cross(v2);
  n1.toString() ;
  // -------- STEP 6
  //compute a vector from the camera(OR pov(0,0,0))to our triangle
  // i.e point 1 of our triangle
  // if we had a camera it would be ( point 1 - camPoint )
  var camVector = p1;
  trace(camVector.toString()+" = camvector");
  // get the dot product of normal and vector to model
  var result;
  result = n1.dot(camVector);
  //result = n1.x*camVector.x + n1.y*camVector.y + n1.z*camVector.z;
  trace(result + " result");
  // if result less than 0 , draw
  // if result greater than 0 , dont draw..
  if(result <= 0){
  // draw it
  with(mc1){
  beginFill(0x00ff00);
  lineStyle(2,0x000000);
  moveTo(p1.x,p1.y);
  lineTo(p2.x,p2.y);
  lineTo(p3.x, p3.y);
  lineTo(p1.x, p1.y);
  endFill();
  }
  Interested in obtaining a job in web programming?
  There are many online college degrees in Information Technology,
  so you can live your dreams. You can find university degrees online as well as education grants to enable your success.
  This method is a lot simpler and seems to work just fine.
  function isVisible(p1,p2,p3){
  return ((p2.x-p1.x)*(p3.y-p1.y)<(p3.x-p1.x)*(p2.y-p1.y));
  }
  .