As I'm sure you can tell, what I'm doing there is rotating the transformgroup in the Y direction - what you want to do is change the translation to step you left or right in the same way that it currently steps you forward.
 
Once you've compensated for the fact that I don't think you can pile transformations on top of each other, that probably translates as something like this:
 
float yStepper=0;
float zStepper=0;
 
if (rightDown || leftDown)
{
    if (rightDown)
    { 
        yStepper+=stepper;
        upSum++;
    } 
    else
    {
        yStepper-=stepper);
        upSum++;
    }
}
 
if (fwDown)
{
    upSum++;
    zStepper=stepper;
}
 
tempTrans.setTranslation(new Vector3d(0.0d, yStepper, zStepper));
 
 
I haven't really worked with this for a while, so I can't guarantee that you need to translate in Y rather than X - but that is worth a shot for managing the sidesteps. You could also add a backwards key very easily from there.
 
Hope that helps,
 
-ben
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]On Behalf Of FantasyFooty.org
Sent: 07 September 2004 14:51
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Newbie Question

Ben, quality tutorial. I wonder if you could help me modify it slightly?
 
I've attached this to the BranchGroup and it happily lets me look around with the mouse.
 
        oMouseRotate_1 = new MouseRotate(MouseBehavior.INVERT_INPUT);
        oMouseRotate_1.setTransformGroup(ourView.getViewPlatformTransform());
        oMouseRotate_1.setSchedulingBounds(bounds);
        objRoot.addChild(oMouseRotate_1);
 
What I would ideally like to do is intstead of 'a' and 'd' spinning him round I would like the mouse to do it.
 
The problem is I would like 'a' to sidestep left and 'd' right. At the moment it does:
 
tempTrans.rotY(0-0.2d);
 
How can I change that so that the purple dude pans across and the mouse direction determining where he looks? (like you get with 1st person shooters). And is orbitbehaviour the same as mouserotate?
----- Original Message -----
From: Ben Moxon
Sent: Tuesday, September 07, 2004 2:16 PM
Subject: Re: [JAVA3D] Newbie Question

I don't know about sample files - I haven't seen any, or maybe I did, but not for a long time and I don't recall where- but if you follow through that tutorial you should be able to sort out a roaming camera approach from it with a bit of extension of the existing behaviour, perhaps looking at combining it with the orbitbehaviour?
 
-ben
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]On Behalf Of FantasyFooty.org
Sent: 07 September 2004 14:02
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Newbie Question

Hi,
 
I'm just getting into Java3D and was wondering whether there are any sample java files on the internet which produce a very basic first person perspective on a bumpy terrain. I've looked and ran the purple dude program from newview and would like something like this only with the camera not being locked in one direction but to follow where he is looking.
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to