 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Thomas Partsch Guest
|
Posted: Tue Dec 19, 2006 6:40 pm Post subject: Scheduling Bounds of a Behavior |
|
|
Hi there!
In Daniel Selmans book "Java 3D Programming" (ISBN 1930110359) there is
an example given for scheduling bounds for a behavior (page 165):
There is a behavior that rotates a wheel only if the car is within 20
meters of the viewer. That is, if the Bounds for the Behavior intersect
the ViewPlatform's activation region.
My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it would be a BoundingSphere)?
Regards,
Thomas |
|
| Back to top |
|
 |
Matthias Guest
|
Posted: Wed Dec 20, 2006 12:56 am Post subject: Re: Scheduling Bounds of a Behavior |
|
|
On Tue, 19 Dec 2006 13:40:58 +0100, Thomas Partsch
<thomas (AT) thomepage (DOT) de> wrote:
| Quote: | My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it would be a BoundingSphere)?
Hi, |
I am totally guessing, but I would think the camera origin?
hth
Matthias
ps. Is turning a car's wheels or not really so important
performance-wise? I mean.. the wheels must be rendered
no matter whether they turn or not. |
|
| Back to top |
|
 |
Thomas Partsch Guest
|
Posted: Wed Dec 20, 2006 1:24 am Post subject: Re: Scheduling Bounds of a Behavior |
|
|
Matthias schrieb:
| Quote: | On Tue, 19 Dec 2006 13:40:58 +0100, Thomas Partsch
thomas (AT) thomepage (DOT) de> wrote:
My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it would be a BoundingSphere)?
Hi,
I am totally guessing, but I would think the camera origin?
hth
Matthias
ps. Is turning a car's wheels or not really so important
performance-wise? I mean.. the wheels must be rendered
no matter whether they turn or not.
|
Hi Matthias!
Don't ask me about performance. The example given is from the book. This
is all about explaining Behaviors not writing a performant application.
In Java 3D API Specifation it is said, that the ViewPlatform's
activation region is a BoundingSphere around the ViewPlatform. If the
Behavior is only activated if the Behavior's Bounds intersect the
ViewPlatforms Bounds, I would guess, the Behavior's Bounds origin would
be the origin of the wheel. Can you follow my thought? |
|
| Back to top |
|
 |
Matthias Guest
|
Posted: Wed Dec 20, 2006 3:14 pm Post subject: Re: Scheduling Bounds of a Behavior |
|
|
On Tue, 19 Dec 2006 20:24:36 +0100, Thomas Partsch
<thomas (AT) thomepage (DOT) de> wrote:
| Quote: | In Java 3D API Specifation it is said, that the ViewPlatform's
activation region is a BoundingSphere around the ViewPlatform. If the
Behavior is only activated if the Behavior's Bounds intersect the
ViewPlatforms Bounds, I would guess, the Behavior's Bounds origin would
be the origin of the wheel. Can you follow my thought?
|
Hi Thomas
as far as i understand the meaning of view platform is more or
less what in some other 3d software is called camera meaning the
location from where you are actually viewing your 3d scene: therefore
your statement would imply that the BoundingSphere's origin is at
your camera (essentially at the point your 'eyes' look at the 3d
scene) and the Behaviour is activated when your wheels get close to
your viewpoint. (So I think it is the other way round you described it
above)
However this is crude guessing, i'm here because i don't really
know java 3d and because i want to learn a bit.. however this
group is not very active
greetings
matthias |
|
| Back to top |
|
 |
sanbikinoraion Guest
|
Posted: Wed Dec 20, 2006 3:50 pm Post subject: Re: Scheduling Bounds of a Behavior |
|
|
| Quote: | My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it would be a BoundingSphere)?
|
Contrary to the other responders, I believe that the origin of the
bounding sphere to get the desired effect should be the origin of the
car. This is why:
I believe that behaviours are triggered when their bounding sphere
intersects the viewplatform's origin, rather than the other way round.
Thinking about it, this is the way that makes sense: if you set the
behaviour's origin to be that of the viewplatform, how would you know
where the behaviour was located?
For a car that may move around your scene graph you'll either have to
have the behaviour update the origin of the scheduling bounds whenever
it moves or use a bit of cleverness due to the way java will pass
point3ds by reference rather than value: you can get the point3d that
represents the origin of the car and set it to be the origin of the
scheduling bounds. That way, whenever the car alters its own origin the
scheduling bounds will automatically update themselves.
Cheers,
Kendrick |
|
| Back to top |
|
 |
Thomas Partsch Guest
|
Posted: Wed Dec 20, 2006 7:08 pm Post subject: Re: Scheduling Bounds of a Behavior |
|
|
sanbikinoraion schrieb:
| Quote: | My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it would be a BoundingSphere)?
Contrary to the other responders, I believe that the origin of the
bounding sphere to get the desired effect should be the origin of the
car. This is why:
I believe that behaviours are triggered when their bounding sphere
intersects the viewplatform's origin, rather than the other way round.
|
I said that, did I not?
| Quote: | Thinking about it, this is the way that makes sense: if you set the
behaviour's origin to be that of the viewplatform, how would you know
where the behaviour was located?
|
That was also my latest thought.
| Quote: | For a car that may move around your scene graph you'll either have to
have the behaviour update the origin of the scheduling bounds whenever
it moves or use a bit of cleverness due to the way java will pass
point3ds by reference rather than value: you can get the point3d that
represents the origin of the car and set it to be the origin of the
scheduling bounds. That way, whenever the car alters its own origin the
scheduling bounds will automatically update themselves.
|
Thanks a lot.
Thomas |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|