[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.gef3d] Re: Problem getting Draw3d to draw something

Hi Tom,

frankly we haven't yet tested or used Draw3D "outside" GEF3D. I have created a view in the graph example which uses Draw3D without GEF3D: org.eclipse.gef3d.examples.graph.editor.Draw3DViewPart. You simply have to update the graph example and test the view in action. Since no camera tool is provided, you cannot move around of course. But at least you could get an impression on how to initialize the Draw3DCanvas and the LightweightSystem3D. This will hopefully help.

Cheers

Jens

For your convenience, here is the initialization snippet from the example. The initial camera position is set to look at (0,0,0) from (0,0,-1000). See my posting on April 1st (Re: Draw3d Program) for details about that.

@Override
public void createPartControl(Composite parent) {
	// some composite
	Composite c = new Composite(parent,SWT.NONE);
	c.setLayout(new FillLayout());
	
	// create a Draw3DCanvas inside:
	LightweightSystem3D lws3D = new LightweightSystem3D();
	lws3D.setDrawAxes(true);
	canvas = Draw3DCanvas.createCanvas(c, SWT.NONE,
			lws3D);
	lws3D.setControl(canvas);
	
	// create some figures:
	...
	
	// set content of lightweight system:
	lws3D.setContents(graphFigure);		
	
}