|
Hey
guys, it's me gain. I'm still trying to implement normal flash
movieclips which can follow a 3d object. I'm having some problems
trying to find out the location of the vertices of a box (type:quad
Quality:1). I extracted the variables from aPoints but none of those
variables seem to relate to the simle lines which are drawn.
Is there something I'm doing wrong?
Otherwise, has anybody got any suggestions on how I can do this?
Thanks!!
Hey there.
You're
in the right place. "aPoints" is an array of Vertex objects describing
the Object3D. To make a movie clip follow along, you need to know the on screen coordinates
of whichever vertex you'd like to follow. Lucky for you (and me, since
i'm using this in a project right now) the Vertex class has public
properties "sx" and "sy". These are the x and y coordinates on your
screen. All you need to do is keep your movie clip centered on these
coordinates and viola! no complex 3d math involved!
myMovie._x = myVertex.sx
or something of that nature, depending on the relative location of your screen in the root movie clip.
Hey, thanks. I'll have to try that. I wish i had known the was an 'sx' property. I ended up doing this :
var coords:String = plane.aPoints[0].toString()
var cas:Number = coords.indexOf("tx:")+3
var cae:Number = coords.indexOf("ty:")-1
_global.sxcoord = coords.substring(cas,cae)
var cbs:Number = coords.indexOf("ty:")+3
var cbe:Number = 16
_global.sycoord = coords.substr(cbs,cbe)
btnOver._x = sxcoord
btnOver._x = sycoord
trace(box.aPoints[0].toString());
trace("sx: "+sxcoord)
trace("sy: "+sycoord)
Oopsie!!
Thank again though!!
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)