I'm trying to point out the 8 x and y postitions in a box ...
Perspective depth is not important in my case.
I do need to incorporate a viewing angle (see attached trig.gif)
any help out there?
Kind Regards
Poden
******** AS *********
Code:
// you'll need to make a linked clip named 'dot'
function attBox(){
var distance = 200; // perspective
var width = 150; // box width
var height= 200; // box height
var depth = 50; // box depth
// it takes 8 (x,y,x points) to make a box
arrX = [width,width,width,width,0,0,0,0] // xpos
arrY = [height,height,0,0,height,height,0,0] // ypos
arrZ = [depth,0,depth,0,depth,0,depth,0] // zpos
for(var i=0;i<arrX.length;i++){ // loop
_root.attachMovie("dot",["dot"+i],i) // attaching mc 'dot'
_mc = _root["dot"+i] // variable mc name
var x = arrX[i];
var y = arrY[i];
var z = arrZ[i];
var perspective_ratio = distance/(distance+z)
var perspective_x = x * perspective_ratio;
var perspective_y = y * perspective_ratio;
_mc._x = perspective_x;
_mc._y = perspective_y;
}
}
attBox()
Here's a work-in-progress that may help you out.
I have movie clip in the library containing a 5x5 black circle and a dynamic text field named "mytext".
var width = 100;
var height = 100;
var depth = 100;
var angle = {x: 0, y: 0};
var tempMouse = {x:0, y:0};
var dragFlag = false;
initialize();
function initialize() {
corner = new Array(8);
corner[0] = new point(-width/2, height/2, depth/2);
corner[1] = new point(-width/2, height/2, -depth/2);
corner[2] = new point(width/2, height/2, -depth/2);
corner[3] = new point(width/2, height/2, depth/2);
corner[4] = new point(-width/2, -height/2, depth/2);
corner[5] = new point(-width/2, -height/2, -depth/2);
corner[6] = new point(width/2, -height/2, -depth/2);
corner[7] = new point(width/2, -height/2, depth/2);