Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/02/2010, 14:13
Silver
 
Fecha de Ingreso: noviembre-2001
Ubicación: México DF
Mensajes: 128
Antigüedad: 22 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Coordenadas de un rectángulo

Este es el código en AS3, por si alguien lo necesita:

Código PHP:
// coordenadas iniciales
var startP:Point = new Point(150,150);
var 
endP:Point = new Point(180,210);
var 
slop:Point = new Point(startP.endP.xstartP.endP.y);
var 
length:Number Math.sqrt(slop.slop.slop.slop.y);
var 
slopVector:Point = new Point(slop.x/lengthslop.y/length);
var 
rHeight:int 5// altura del rectángulo
var offset:Point = new Point(rHeight slop.lengthrHeight * -slop.length); 

// obteniendo los 4 puntos para el dibujo
var topLeft:Point = new Point(startP.offset.xstartP.offset.y);
var 
bottomLeft:Point = new Point(startP.offset.xstartP.offset.y);
var 
topRight:Point = new Point(endP.offset.xendP.offset.y);
var 
bottomRight:Point = new Point(endP.offset.xendP.offset.y); 

// dibujando el rectángulo
var shape:Shape = new Shape();
shape.graphics.lineStyle(1,0x000000);
shape.graphics.beginFill(0xFF0000);
shape.graphics.moveTo(topLeft.xtopLeft.y);
shape.graphics.lineTo(topRight.xtopRight.y);
shape.graphics.lineTo(bottomRight.xbottomRight.y);
shape.graphics.lineTo(bottomLeft.xbottomLeft.y);
shape.graphics.lineTo(topLeft.xtopLeft.y);
shape.graphics.endFill();
addChild(shape); 
__________________
Nuedi Servicios SA de CV
http://www.nuedi.mx