I used this to tween a plane in the direction it's facing, can't tell you if
it will work in 2.5 or not, but give it a go. Something Fabrice pointed me
in the direction in mid 2009, not sure what version away3d was on then but
may work.
//
------------------------------------------------------------------------------------------------
public function overHandler(e:MouseEvent3D):void
{
var plane:Plane = e.target as Plane;
//plane.pushfront = true;
// work out move forward direction by 1000 and tween to that number3d
var target:Number3D = plane.transform.forward;
target.scale(plane.position,-0.2);
target.add(target,plane.position);
plane.pushfront = true;
plane.pushback = false;
var nTargetScale:Number = 1.5;
TweenLite.to(plane,1,
{
x:target.x,
y:target.y,
z:target.z,
scaleX:nTargetScale ,
scaleY:nTargetScale,
scaleZ:nTargetScale
}
);
}
//
------------------------------------------------------------------------------------------------
On 16 June 2010 09:48, Michael Iv <[email protected]> wrote:
> Believe me there is a hell of difference when you run it on FP10. I
> switched several commercial projects from back then with 2.3 to 3.3 .When
> the project is complex you see the differences immediately . :) Strongly
> suggest you to do the same if you don't want to waste your time later.
>
>
> On Wed, Jun 16, 2010 at 11:43 AM, jens lofberg <[email protected]>wrote:
>
>> I guess I will use 3.5 later but now I just made some small testing using
>> the not so funny project (flash 9) I'm working on.
>> and I didn't see any speed difference between 2.5 and 3.5 so I don't see
>> or read any good point why using it yet.
>>
>> jens
>>
>> Le 16/06/2010 10:36, Michael Iv a écrit :
>>
>> Sure , I gave you from 3.5. Sorry for this question but why would you want
>> to use 2.5?
>>
>> On Wed, Jun 16, 2010 at 11:35 AM, jens lofberg <[email protected]>wrote:
>>
>>> No =(
>>> getAngle() dont excists in normal (away3D 2.5.0)
>>> I found _fAngle in geometry.as but this variable is private.
>>>
>>> What I would like to do is to get al the forces on an item placed on a
>>> plane due to gravity and the angle of the ground, so I would need the angle
>>> of 'ground' at the point where my item is placed. (I'm using elevation on a
>>> plane to create the ground)
>>>
>>> But I have another idea how to solve my problem using the
>>> Elevationreader:
>>> I just check the difference in height on the point where my object is and
>>> 1 pixels to the side of it. If I do this in two direction I get my angle =)
>>> Actually I don't even have to calculate the angle to make it simple. I
>>> just say that the force in x,y is equal to this difference (and gravity is
>>> the force in z).
>>>
>>> But first I have to go back to finishing the work I should have been
>>> working on =(
>>>
>>> jens
>>>
>>>
>>>
>>> Le 16/06/2010 10:02, Michael Iv a écrit :
>>>
>>> 'worked OK?
>>>
>>> On Wed, Jun 16, 2010 at 10:58 AM, jens lofberg <[email protected]>wrote:
>>>
>>>> perfect, thanks!
>>>> jens
>>>>
>>>>
>>>> Le 15/06/2010 20:24, Michael Iv a écrit :
>>>>
>>>> face.normal.getAngle() should do the work.
>>>>
>>>> On Tue, Jun 15, 2010 at 6:17 PM, savagelook <
>>>> [email protected]> wrote:
>>>>
>>>>> Check the showNormals block of the renderTriangle() function in
>>>>> BitmapMaterial. I don't have time to dig in right now, but that's how
>>>>> the away3d code shows a line indicating the direction of the normals
>>>>> on a triangle. This should help you get want you want.
>>>>>
>>>>> On Jun 15, 11:12 am, savagelook <[email protected]> wrote:
>>>>> > I could be wrong cause I'm not looking at the code, but I would
>>>>> assume
>>>>> > that "face[0].normal" is returning the vector of the normal, or
>>>>> simply
>>>>> > its direction. You might need to calculate the center of the face by
>>>>> > using its 3 vertices, not sure if away3d has this center point built
>>>>> > in. I don't know how to do that calculation off hand, though, sorry.
>>>>> >
>>>>> > On Jun 15, 10:52 am, jens lofberg <[email protected]> wrote:
>>>>> >
>>>>> >
>>>>> >
>>>>> > > Hi
>>>>> > > I would like to use the angle of the face.normal but I don't
>>>>> understand it.
>>>>> > > trace(face[0].normal) only give me one 3d point (x,y,z)? To use the
>>>>> > > angle I need two points?
>>>>> >
>>>>> > > THANKS
>>>>> > > jens
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Ivanov ,Programmer
>>>> Neurotech Solutions Ltd.
>>>> Flex|Air |3D|Unity|
>>>> www.neurotechresearch.com
>>>> http://blog.alladvanced.net
>>>> http://www.meetup.com/GO3D-Games-Opensource-3D/
>>>> Tel:054-4962254
>>>> [email protected]
>>>> [email protected]
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Michael Ivanov ,Programmer
>>> Neurotech Solutions Ltd.
>>> Flex|Air |3D|Unity|
>>> www.neurotechresearch.com
>>> http://blog.alladvanced.net
>>> http://www.meetup.com/GO3D-Games-Opensource-3D/
>>> Tel:054-4962254
>>> [email protected]
>>> [email protected]
>>>
>>>
>>>
>>
>>
>> --
>> Michael Ivanov ,Programmer
>> Neurotech Solutions Ltd.
>> Flex|Air |3D|Unity|
>> www.neurotechresearch.com
>> http://blog.alladvanced.net
>> http://www.meetup.com/GO3D-Games-Opensource-3D/
>> Tel:054-4962254
>> [email protected]
>> [email protected]
>>
>>
>>
>
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air |3D|Unity|
> www.neurotechresearch.com
> http://blog.alladvanced.net
> http://www.meetup.com/GO3D-Games-Opensource-3D/
> Tel:054-4962254
> [email protected]
> [email protected]
>
>