This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=261 as retrieved on 1 Aug 2007 10:38:47 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:f92DSPRJIEcJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D261+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=48


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Finding an objects vertices?

Posted by: ravenblight Jan 11 2007, 11:21 AM

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!!

Posted by: evanFlash Mar 1 2007, 07:49 PM

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.

Posted by: ravenblight Mar 5 2007, 02:02 PM

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)