The scaling of an object is done as written below by Eric. If you
see that the scaling is also influencing the position then you have:

1. The object is not possitioned at origo (center of the object)
2. The coordinates of the object are off-origo.

The first is not that difficult. You have to remember your translation
coordinates, reset it to origo, scale and move it back again.

It is more difficult to do the item 2). You have to find coordinates of
your object (the geometry arrays) find the center, scale the object,
and reverse scale the position of the center of the object and translate
the object with this value. I have a code snip if you need to do the
last thing (please give me a beeeeepppp if you need it).

Ole Vilmann
Danish Maritime Institute

-----Original Message-----
From: Eric Reiss [mailto:[EMAIL PROTECTED]]
Sent: 18. januar 2001 15:20
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Behavior Problems!


I'm not familiar with the scaling behavior but the way that the other
behaviors needed corrected is basically a coordinate transformation.

You may need to modify the scaling behavior so that it remembers the
objects position, then translates it to the origin, scales it and then
translates it back to its original position.

In this case, the viewplatform is unimportant since you will just be saving
the original corrdinates and then moving it to the origin and back to the
original location after the scaling operation.

$0.02




At 08:21 AM 01/18/2001 +0100, you wrote:
>Hi there,
>
>I am having a problem with my PickBehaviors.  I am using a Scale, Translate
>and a rotate behavior and they work fine.  But they do not satisfy my
needs.
>For example:  When I rotate an object, it rotates itself around the origin.
>When I scale an object, it scales but also moves to the origin.  How can I
>solve this.   I've already tried the PickOrbitBehavior from Eric but that
>only works on the ViewPlatform.  I'am desperate, please help me.  Any help
>is welcome.
>
>Thanks a lot.
>
>
>--------------------------------------------------
>Thijs Maenhout
>Software Developer
>
>QMatics nv
>Bruggesteenweg 112
>8830 Hooglede - Belgium
>--------------------------------------------------
>Tel.    +32 51 27 24 00
>Fax     +32 51 27 24 01
>--------------------------------------------------
>mailto:[EMAIL PROTECTED]
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".

***********************************************************************
Eric Reiss
Manager MEMS Lab
Swanson New Product Incubator
School of Engineering  - University of Pittsburgh

3700 O'Hara Street
647 Benedum Hall
Pittsburgh, PA 15261
Phone: 412-624-9696
Email: [EMAIL PROTECTED]
http://www.sigda.acm.org/Eric/
***********************************************************************

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to