[quote]Thanks Preston, I will try this. When I move around using cursor keys, I have x,y,z values but no angles so I guess I can just pass 0. Is this right?
[/quote]
Yes. And in case you prefer to handle radian angles (0 … PI) and not angles degrees (0…360) you can skip that Math.toRadians() method call, too.
[quote]Another thing is that where do I attach the camera to. Do I add it to the locale or do I add it to the root BranchGroup? (to get a kind of first person view)
tomcat
[/quote]
Yes, exactly. For my previously quoted example I’ve just made something like this:
private View mView = new View();
private BranchGroup mSceneBg = new BranchGroup(); // Root-Branchgroup
void initXith(Canvas3D kanvas3d)
{
RenderPeer renderpeer = new RenderPeerImpl();
CanvasPeer canvaspeer = renderpeer.makeCanvas(freim, 320, 200, Opt.sGuiVollbildBpp, false);
kanvas3d.set3DPeer(canvaspeer);
mView.addCanvas3D(kanvas3d);
VirtualUniverse univers = new VirtualUniverse();
Locale lokal = new Locale();
univers.addLocale(lokal);
univers.addView(mView);
lokal.addBranchGraph(mSceneBg);
}