当前位置: 首页>>代码示例>>Java>>正文


Java SimpleUniverse.getPreferredConfiguration方法代码示例

本文整理汇总了Java中com.sun.j3d.utils.universe.SimpleUniverse.getPreferredConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleUniverse.getPreferredConfiguration方法的具体用法?Java SimpleUniverse.getPreferredConfiguration怎么用?Java SimpleUniverse.getPreferredConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.j3d.utils.universe.SimpleUniverse的用法示例。


在下文中一共展示了SimpleUniverse.getPreferredConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Points3DPanel

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Points3DPanel(PointsShape ptsShape) {
	setLayout(new BorderLayout());
	setOpaque(false);

	setPreferredSize(new Dimension(PWIDTH, PHEIGHT));

	GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
	Canvas3D canvas3D = new Canvas3D(config);
	add("Center", canvas3D);
	canvas3D.setFocusable(true);
	canvas3D.requestFocus(); // the canvas now has focus, so receives key
								// events

	su = new SimpleUniverse(canvas3D);

	createSceneGraph(ptsShape);
	initUserPosition(); // set user's viewpoint
	orbitControls(canvas3D); // controls for moving the viewpoint

	su.addBranchGraph(sceneBG);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:22,代码来源:Points3DPanel.java

示例2: Java3DPanel

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
Java3DPanel() {
    super();
    setLayout(new BorderLayout());
    Canvas3D canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
    add(canvas3D);
    SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
    simpleU.getViewingPlatform().setNominalViewingTransform();
    try {
        BranchGroup branchGroup = new BranchGroup();
        TransformGroup transformGroup = getInteractiveTransformGroup();
        branchGroup.addChild(transformGroup);
        buildScene(transformGroup);
        branchGroup.compile();
        simpleU.addBranchGraph(branchGroup);
    } catch (Exception e) {
        e.printStackTrace();
    }
    setVisible(true);
}
 
开发者ID:tekrei,项目名称:JavaExamples,代码行数:20,代码来源:Java3DPanel.java

示例3: MainApp

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
/** Creates a new instance of MainApp
 * Create a simple scene and attach it to the virtual universe
 *
 */
public MainApp(String[] args) {

    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();

    Canvas3D canvas3D = new Canvas3D(config);
    add("Center", canvas3D);

    // SimpleUniverse is a Convenience Utility class
    simpleU = new SimpleUniverse(canvas3D);

    // This will move the ViewPlatform back a bit so the
    // objects in the scene can be viewed.
    simpleU.getViewingPlatform().setNominalViewingTransform();

    BranchGroup scene = createSceneGraph(args.length > 0);
    orbitControls(canvas3D);
    simpleU.addBranchGraph(scene);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:24,代码来源:MainApp.java

示例4: Points3DPanel

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Points3DPanel(PointsShape ptsShape) {
  setLayout(new BorderLayout());
  setOpaque(false);

  setPreferredSize(new Dimension(PWIDTH, PHEIGHT));

  GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
  Canvas3D canvas3D = new Canvas3D(config);
  add("Center", canvas3D);
  canvas3D.setFocusable(true);
  canvas3D.requestFocus(); // the canvas now has focus, so receives key
  // events

  su = new SimpleUniverse(canvas3D);

  createSceneGraph(ptsShape);
  initUserPosition(); // set user's viewpoint
  orbitControls(canvas3D); // controls for moving the viewpoint

  su.addBranchGraph(sceneBG);
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:22,代码来源:Points3DPanel.java

示例5: doPreview

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
@Override
public void doPreview() {
	GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
	Canvas3D canvas = new Canvas3D(config);
	canvas.setPreferredSize(new Dimension(CANVAS_PREFERRED_WIDTH, CANVAS_PREFERRED_HEIGHT));
	BranchGroup scene = createSceneGraph();
	this.universe = new SimpleUniverse(canvas);
	// Move the camera back on the z-axis
	Transform3D cameraTransform = new Transform3D();
	TransformGroup viewPlatformGroup = this.universe.getViewingPlatform().getViewPlatformTransform();
	cameraTransform.setTranslation(new Vector3f(0, 0, CAMERA_Z_POSITION));
	viewPlatformGroup.setTransform(cameraTransform);
	// Necessary to see the whole model
	this.universe.getViewer().getView().setBackClipDistance(BACK_CLIP_DISTANCE);
	this.universe.addBranchGraph(scene);
	super.preview.setCanvas(canvas, true);
}
 
开发者ID:nerdouille,项目名称:silvie,代码行数:18,代码来源:ModelPreviewer.java

示例6: Main3D

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Main3D() {
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    add(canvas, BorderLayout.CENTER);

    universe = new SimpleUniverse(canvas);

    // �V�[�����\�z
    BranchGroup scene = createSceneGraph();
    scene.compile();

    // ���_���Z�b�g
    universe.getViewingPlatform().setNominalViewingTransform();

    // �}�E�X����
    orbitControls(canvas);

    universe.addBranchGraph(scene);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:22,代码来源:Main3D.java

示例7: MainPanel

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public MainPanel() {
    setPreferredSize(new Dimension(WIDTH, HEIGHT));
    setLayout(new BorderLayout());

    // 3D���f����`�悷��L�����p�X���쐬
    GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
    Canvas3D canvas3D = new Canvas3D(config);
    add(canvas3D, BorderLayout.CENTER);
    canvas3D.setFocusable(true);
    canvas3D.requestFocus();

    // ���E���쐬
    universe = new SimpleUniverse(canvas3D);

    createSceneGraph(); // ���E�i�V�[���O���t�j���\�z
    initUserPosition(); // ���[�U�̎��_��������
    orbitControls(canvas3D); // �}�E�X����

    universe.addBranchGraph(sceneBG);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:22,代码来源:MainPanel.java

示例8: Main

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Main() {
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    add(canvas, BorderLayout.CENTER);

    universe = new SimpleUniverse(canvas);

    // �V�[�����\�z
    BranchGroup scene = createSceneGraph();
    scene.compile();

    // ���_���Z�b�g
    universe.getViewingPlatform().setNominalViewingTransform();

    // �}�E�X����
    orbitControls(canvas);

    universe.addBranchGraph(scene);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:22,代码来源:Main.java

示例9: Main

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Main() {
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    add(canvas, BorderLayout.CENTER);

    universe = new SimpleUniverse(canvas);

    // �V�[�����\�z
    BranchGroup scene = createSceneGraph();
    scene.compile();

    // ���_���Z�b�g
    Transform3D viewPlatformTransform = new Transform3D();
    viewPlatformTransform.setTranslation(new Vector3d(0.0, 0.0, 10.0));
    universe.getViewingPlatform().getViewPlatformTransform().setTransform(viewPlatformTransform);

    // �}�E�X����
    orbitControls(canvas);

    universe.addBranchGraph(scene);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:24,代码来源:Main.java

示例10: CrystalBall

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public CrystalBall() {
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse
            .getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    add(canvas, BorderLayout.CENTER);

    universe = new SimpleUniverse(canvas);

    // �V�[�����\�z
    BranchGroup scene = createSceneGraph();
    scene.compile();

    // ���_���Z�b�g
    universe.getViewingPlatform().setNominalViewingTransform();

    // �}�E�X����
    orbitControls(canvas);

    universe.addBranchGraph(scene);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:22,代码来源:CrystalBall.java

示例11: RotatingCube

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public RotatingCube() {
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    add(canvas, BorderLayout.CENTER);

    SimpleUniverse universe = new SimpleUniverse(canvas);

    // �V�[�����\�z
    BranchGroup scene = createSceneGraph();
    scene.compile();
    
    // ���_���Z�b�g
    universe.getViewingPlatform().setNominalViewingTransform();
    
    universe.addBranchGraph(scene);
}
 
开发者ID:aidiary,项目名称:javagame,代码行数:18,代码来源:RotatingCube.java

示例12: setupViews

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
@Override
public void setupViews() {
    remove(loaderCanvas);
    Panel multiviews = new Panel(new GridLayout(storeys.size(), 0));
    multiviews.setSize(800, storeys.size() * 400);
    int row = 0;
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.add(multiviews);
    for (ViewSpecificGroup storey : storeys) {
        Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
        canvas.setSize(800, 400);
        AxonometricView view = new AxonometricView(canvas);
        universe.addView(view);
        view.zoomToExtent(storey, 1);
        storey.addView(view.getView());
        multiviews.add(canvas, row);
        canvas.setVisible(true);
        row++;
    }
    add(scrollPane, BorderLayout.CENTER);
    validate();
}
 
开发者ID:hlg,项目名称:billie,代码行数:23,代码来源:ExplodedAxonometrie.java

示例13: Fractal3DPictureView

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public Fractal3DPictureView(Fractal3DModel model, Fractal3DController controller) {
       this.model = model;
	this.controller = controller;
	model.addObserver(this);

       setPreferredSize(new Dimension(400, 400));
       setLayout(new BorderLayout());

       GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
       canvas = new Canvas3D(config);
       add(canvas);

       universe = new SimpleUniverse(canvas);
       universe.getViewingPlatform().setNominalViewingTransform();

       canvas.addMouseListener(new MouseInteractionListener());

       scene = null;

	update();
}
 
开发者ID:sleepyprof,项目名称:Fractal,代码行数:22,代码来源:Fractal3DPictureView.java

示例14: init

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
public void init()
{
setLayout(new BorderLayout());
GraphicsConfiguration config =
		SimpleUniverse.getPreferredConfiguration();

Canvas3D c = new Canvas3D(config);
add("Center", c);

// Create a simple scene and attach it to the virtual universe
BranchGroup scene = createSceneGraph();
u = new SimpleUniverse(c);

// This will move the ViewPlatform back a bit so the
// objects in the scene can be viewed.
u.getViewingPlatform().setNominalViewingTransform();

u.addBranchGraph(scene);
}
 
开发者ID:dhmay,项目名称:msInspect,代码行数:20,代码来源:SurfaceFrame.java

示例15: createOffscreenCanvas

import com.sun.j3d.utils.universe.SimpleUniverse; //导入方法依赖的package包/类
private void createOffscreenCanvas() {

        GraphicsConfiguration config = SimpleUniverse
                .getPreferredConfiguration();
        offScreenCanvas = new Canvas3D(config, true);

        Screen3D sOn = ScatterPlot3DGUI.plotCanvas.getScreen3D();
        Screen3D sOff = offScreenCanvas.getScreen3D();

        Dimension dim = sOn.getSize();
        dim.width *= OFF_SCREEN_SCALE;
        dim.height *= OFF_SCREEN_SCALE;

        sOff.setSize(dim);
        sOff.setPhysicalScreenWidth(sOn.getPhysicalScreenWidth()
                * OFF_SCREEN_SCALE);
        sOff.setPhysicalScreenHeight(sOn.getPhysicalScreenHeight()
                * OFF_SCREEN_SCALE);

    }
 
开发者ID:airalcorn2,项目名称:ScatterPlot3D,代码行数:21,代码来源:ScatterPlot3D.java


注:本文中的com.sun.j3d.utils.universe.SimpleUniverse.getPreferredConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。