 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
marmu Guest
|
Posted: Fri Dec 22, 2006 8:50 pm Post subject: multiple behaviors on multiple objects / move everything and |
|
|
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 |
|
| Back to top |
|
 |
sanbikinoraion Guest
|
Posted: Tue Jan 09, 2007 3:31 pm Post subject: Re: multiple behaviors on multiple objects / move everything |
|
|
marmu wrote:
| Quote: | 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.
|
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.
| Quote: | 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...
|
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 |
|
| Back to top |
|
 |
marmu Guest
|
Posted: Tue Jan 09, 2007 6:39 pm Post subject: Re: multiple behaviors on multiple objects / move everything |
|
|
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:
| Quote: | marmu wrote:
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.
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
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...
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 |
|
|
| Back to top |
|
 |
sanbikinoraion Guest
|
Posted: Fri Jan 12, 2007 7:35 pm Post subject: Re: multiple behaviors on multiple objects / move everything |
|
|
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!
marmu wrote:
| Quote: | 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:
marmu wrote:
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.
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
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...
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 |
|
|
| 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
|
|