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 / January 2007

Tip: Looking for answers? Try searching our database.

multiple behaviors on multiple objects / move everything and if picked only one object

Thread view: 
marmu - 22 Dec 2006 14:50 GMT
Hello everyone,

I`m having great trouble by programming the following:

We are programming a miniature golf-game at university.
We want to enable the user to rotate, zoom and translate everything he
sees at once. We did this with an OrbitBehavior. As far as I know an
OrbitBehavior cannot be limited to angles and zoomfactor, is that
right? Because later we want to limit the zoom and the user shoudn`t be
able to look beneath the ground.

The other thing is an arrow, which we want to use for the drive. The
user should rotate it around one axis to set the direction. And the
size of the arrow should represent the power of the drive.
Problem here is the rotation around one axis.
This is not want the PickRotateBehavior is for. Probably I have to
program my own behavior but how?
I`m using PickRotateBehavior and PickZoom. But Zoom doesn`t change the
size, it does what its name says, it zooms. So the arrow gets nearer to
the user...

If there are problems with using OrbitBehavior (for the whole scene)
together with PickRotate and PickZoom (for the arrow), please tell me.
I tried to replace the OrbitBehavior with PickRotate, PickTranslate and
PickZoom for the whole scene. And then I wanted to pick the arrow as
stated above.. But I can only pick the arrow and zoom it. Rotation of
the arrow doesn`t work and PickRotate, PickTranslate and PickZoom for
everything doesn`t work either.

Three Days passed and I`m stuck. Please give me some hints on how to
realize this and what tools I should use for that.
If you need some of my code, tell me so. My code is kind of messy, but
I`ll structure it for you and show you the important extracts.

I would really appreciate your help. Thanks in advance.

Cheers,
Marcus
sanbikinoraion - 09 Jan 2007 09:31 GMT
> Hello everyone,
>
[quoted text clipped - 6 lines]
> right? Because later we want to limit the zoom and the user shoudn`t be
> able to look beneath the ground.

It's my understanding that the angles and so on cannot be limited -
however, the source code to the orbitbehavior is available online if
you look hard enough (it's in the java3d source repository, but you can
get it via the web, without having to configure CVS), so you should be
able to download that and create a child class that is modified to your
requirements.

> The other thing is an arrow, which we want to use for the drive. The
> user should rotate it around one axis to set the direction. And the
[quoted text clipped - 5 lines]
> size, it does what its name says, it zooms. So the arrow gets nearer to
> the user...

You will indeed have to program your own behaviour. How you go about
doing it depends on what method of interaction you require - if it's
using the mouse, then you need to create a behaviour that reacts to
mouse inputs such as button press, button up, drag, and so on. There
are a few tutorials that will show you how to do this, but essentially
you'll want the AWTEventListener of the behaviour to alter the size of
the arrow object by calling a method on the arrow object.

-sanbikinoraion
marmu - 09 Jan 2007 12:39 GMT
Hi,

the behaviors for the arrow are done. Now I got to get the altered
OrbitBehavior to work.
But I`ll start today, so I cannot tell you anything right now. I`m a
little bit afraid of writing my own OrbitBehavior. The other beahviors
took so long. I only have 3 weeks left and there are several other
things to do, as always ;)

Thanks a lot for your help. I solved the arrow thing by myself and
learned a lot. I hope to suceed in writing my OrbitBehavior. If you got
any hints on how and where to set some limits I would really appreciate
your comment.

Cheers

sanbikinoraion schrieb:

> > Hello everyone,
> >
[quoted text clipped - 33 lines]
>
> -sanbikinoraion
sanbikinoraion - 12 Jan 2007 13:35 GMT
I'm afraid I've never looked at the source for orbitbehavior. I suspect
that the angle modification will be made in the processAWTEvent
function, but judging by the vast number of things that must also
happen in that method, it may be a bit of a chore to find exactly the
right place!

> Hi,
>
[quoted text clipped - 51 lines]
> >
> > -sanbikinoraion


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.