Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / December 2006

Tip: Looking for answers? Try searching our database.

Scheduling Bounds of a Behavior

Thread view: 
Thomas Partsch - 19 Dec 2006 12:40 GMT
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
Matthias - 19 Dec 2006 18:56 GMT
>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.
Thomas Partsch - 19 Dec 2006 19:24 GMT
Matthias schrieb:

>> 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
[quoted text clipped - 11 lines]
> 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?
Matthias - 20 Dec 2006 09:14 GMT
>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
sanbikinoraion - 20 Dec 2006 09:50 GMT
> 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
Thomas Partsch - 20 Dec 2006 13:08 GMT
sanbikinoraion schrieb:
>> 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
[quoted text clipped - 6 lines]
> 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?

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

> 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
[quoted text clipped - 3 lines]
> scheduling bounds. That way, whenever the car alters its own origin the
> scheduling bounds will automatically update themselves.

Thanks a lot.
Thomas


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.