Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3054 Members - Latest Member: Ljustin770

11. February 2012, 12:41:39 PM
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Canvas3DJPanel just shows garbage
Pages: [1]
Print
Author Topic: Canvas3DJPanel just shows garbage  (Read 382 times)
mipadi
Just dropped in

Offline Offline

Posts: 4


View Profile WWW
« on: 26. February 2010, 03:55:04 PM »

I'm working on a program that will use a Canvas3DJPanel to display a scene. So far, though, it is supposed to be empty -- I followed the tutorial for the empty scene in XIN. But instead, the canvas shows a bunch of garbage:



Specifically, I think it's showing an amalgam of thumbnails from the Top Sites page in the Safari browser. Obviously I'm not displaying these thumbnails at all with my program!

The code that I'm using to create the canvas is pretty simple. It's first initialized in a method with this code:

Code:
panel = new JPanel(new GridLayout(1,1));
canvasPanel = new Canvas3DJPanel(32);
panel.add(canvasPanel);
add(panel);

And then passed into an environment that sets up the Xith3D environment:

Code:
env = new Xith3DEnvironment(this);
env.addCanvas(canvas);
canvas.setBackgroundColor(Colorf.WHITE);
this.begin();    // this is a subclass of RenderLoop

Any idea what's happening?
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #1 on: 26. February 2010, 04:51:59 PM »

Your panel is showing some random video memory data because it has nothing to render. Try adding a RenderPass with :
Code:
env.addPerspectiveBranch();
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #2 on: 26. February 2010, 05:30:46 PM »

Try to clear the canvas.

Marvin
Logged
mipadi
Just dropped in

Offline Offline

Posts: 4


View Profile WWW
« Reply #3 on: 26. February 2010, 07:15:20 PM »

Your panel is showing some random video memory data because it has nothing to render. Try adding a RenderPass with :
Code:
env.addPerspectiveBranch();
Awesome, that worked -- thanks!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic