AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

multiple behaviors on multiple objects / move everything and

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
marmu
Guest





PostPosted: Fri Dec 22, 2006 8:50 pm    Post subject: multiple behaviors on multiple objects / move everything and Reply with 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.

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





PostPosted: Tue Jan 09, 2007 3:31 pm    Post subject: Re: multiple behaviors on multiple objects / move everything Reply with quote



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





PostPosted: Tue Jan 09, 2007 6:39 pm    Post subject: Re: multiple behaviors on multiple objects / move everything Reply with 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:

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





PostPosted: Fri Jan 12, 2007 7:35 pm    Post subject: Re: multiple behaviors on multiple objects / move everything Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.