Today earlier one guy here asked how to optimize his geometry .He was using
64 different plains for cheese cell in order to highlight them when a chess
takes a cell .  I once did something similar in PV3D but with JIGLIB where I
needed to check if my car is still on the road . So I was casting a ray  and
gettting materials pixels colors and by this getting to know if I am on the
road or not . Now I wanted to help this guy .And because I could not find
the ray casting code that I have done sometime ago and also because I knew
that in Away there is RAY so decided to try it on sphere . I thought that
getIntersect returns us a face where the intersection is happening . But
actually I paid attention that that it returns some Number 3d data once per
30-40 samplings because  I tried to loops througth all the faces while
testing the intersect like this :
///// it runs on enter frame////////////////
for(var i:int=0;i<_sf.faces.length;++i){

trace(_ray.getIntersect(_ray.orig,_ray.dir,_sf.faces[i].v0.position,_sf.faces[i].v1.position,_sf.faces[i].v2.position));
   }
and basically I am getting some output once a 200-300 frames .
May be it is good only for plains ?

//////////////////////////////////////

On Tue, May 4, 2010 at 12:16 AM, Reinorvak <[email protected]>wrote:

> One of the strange quirks of Away3D that I've discovered working on
> enclosed spaces, is that the mouse X,Y,Z stops at the first object it
> hits and doesn't continue farther into the scene. I've also tried my
> own C++ versions of ray casting in Away3D to come up fruitless. What
> exactly are you trying to achieve with this ray intersection?
>
> On May 3, 4:43 pm, Michael Iv <[email protected]> wrote:
> > Yes , but the problem is that there has to be one because I am casting a
> ray
> > from cam position to the mouse screen X Y Z coords . So I am pointing to
> the
> > very Face where I should get the intersection
> >
> > On Mon, May 3, 2010 at 11:10 PM, Reinorvak <[email protected]
> >wrote:
> >
> >
> >
> > > The number3D that the function returns, I believe, is the point of
> > > intersection. If the return should show up blank, there is no
> > > intersection.
> >
> > > On May 3, 4:03 pm, Michael Iv <[email protected]> wrote:
> > > > I thought about it and tried to test against face v0 v1 v2  of sphere
> .
> > > Got
> > > > nothing of this .
> >
> > > > On Mon, May 3, 2010 at 10:50 PM, Reinorvak <
> [email protected]
> > > >wrote:
> >
> > > > > v0-2, are the vertices used in a triangle. getIntersect is testing
> if
> > > > > the starting point p0, and the ending point p1, intersect the
> triangle
> > > > > defined by v0, v1, and v2.
> >
> > > > > On May 3, 3:43 pm, Michael Iv <[email protected]> wrote:
> > > > > > Someone can tell me what are* v0,v1,v2* in*
> > > Ray.getIntersect(p0:Number3D,
> > > > > > p1:Number3D, v0:Number3D, v1:Number3D, v2:Number3D):Number3D* ???
> > > > > > Just can't find any example explaining these
> >
> > > > > > Thanks!
> >
> > > > > > --
> > > > > > Michael Ivanov ,Programmer
> > > > > > Neurotech Solutions Ltd.
> > > > > > Flex|Air |3D|Unity|www.neurotechresearch.com
> > > > > > Tel:054-4962254
> > > > > > [email protected]
> > > > > > [email protected]
> >
> > > > --
> > > > Michael Ivanov ,Programmer
> > > > Neurotech Solutions Ltd.
> > > > Flex|Air |3D|Unity|www.neurotechresearch.com
> > > > Tel:054-4962254
> > > > [email protected]
> > > > [email protected]
> >
> > --
> > Michael Ivanov ,Programmer
> > Neurotech Solutions Ltd.
> > Flex|Air |3D|Unity|www.neurotechresearch.com
> > Tel:054-4962254
> > [email protected]
> > [email protected]
>



-- 
Michael Ivanov ,Programmer
Neurotech Solutions Ltd.
Flex|Air |3D|Unity|
www.neurotechresearch.com
Tel:054-4962254
[email protected]
[email protected]

Reply via email to