1 Reply Latest reply on Aug 20, 2009 10:58 PM by kglad

    creating a line with nulls

    VicTropic

      I am using actionscript 2.0 and I am  trying to develope a line in 3d space.

      When I try to create a line base off of two variables, it doesn't work.

      But when I trace those vars it give me the solutions.

       

       

          

         point1x = 5;
      point1y = 5;
      point1z = 5;
      point2x = 10;
      point2y = 5;
      point2z = 5;
      midpointx = 275;
      midpointy = 200;


      _root.createEmptyMovieClip("holder",1);
      holder.lineStyle(2,0x000000,100);
      holder.moveTo(point1rendx,point1rendy);
      holder.lineTo(point2rendx,point2rendy);

       

      zplusx1 = point1x/point1z;
      zplusy1 = point1y/point1z;
      zplusx2 = point2x/point2z;
      zplusy2 = point2y/point2z;

       

      point1calcx = zplusx1+point1x;
      point1calcy = zplusy1+point1y;
      point2calcx = zplusx2+point2x;
      point2calcy = zplusy2+point2y;

       

      point1rendx = point1calcx + midpointx;
      point1rendy = point1calcy + midpointy;
      point2rendx = point2calcx + midpointx;
      point2rendy = point2calcy + midpointy;

       

      trace(point1rendx)
      trace(point1rendy)
      trace(point2rendx)
      trace(point2rendy)