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


Java View.setPhysicalEnvironment方法代码示例

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


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

示例1: initView

import javax.media.j3d.View; //导入方法依赖的package包/类
private static BranchGroup initView( View view, TransformGroup trans, Canvas3D canvas )
{
    ViewPlatform vp = new ViewPlatform();
    trans .setCapability( TransformGroup .ALLOW_TRANSFORM_WRITE );
    BranchGroup bg = new BranchGroup();
    bg .addChild( trans );
    trans .addChild( vp );
    view .addCanvas3D( canvas );
    view .setPhysicalBody( new PhysicalBody() );
    view .setPhysicalEnvironment( new PhysicalEnvironment() );
    view .attachViewPlatform( vp );
    view .setFrontClipPolicy( View.VIRTUAL_EYE );
    view .setBackClipPolicy( View.VIRTUAL_EYE );
    view .setScreenScalePolicy( View .SCALE_EXPLICIT );
    return bg;
}
 
开发者ID:vZome,项目名称:vzome-desktop,代码行数:17,代码来源:Java3dRenderingViewer.java

示例2: createViewPlatform

import javax.media.j3d.View; //导入方法依赖的package包/类
void createViewPlatform() {
	// viewplatform
	viewPlatform = new ViewPlatform();
	viewPlatform.setActivationRadius(100f);
	viewPlatform.setViewAttachPolicy(View.NOMINAL_HEAD);
	// view
	view = new View();

	view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
	view.setViewPolicy(View.SCREEN_VIEW);
	view.attachViewPlatform(viewPlatform);
	// physical body
	PhysicalBody phyBody = new PhysicalBody();
	view.setPhysicalBody(phyBody);
	// physical environment
	PhysicalEnvironment phyEnv = new PhysicalEnvironment();
	view.setPhysicalEnvironment(phyEnv);
	// ???? pas compris , pour l'antiliasing
	GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
	template.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
	GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(template);
	// antialiasing
	view.setSceneAntialiasingEnable(true);
	/*
	 * to add a onscreen canvas canvas3d = new Canvas3D(config);
	 * view.addCanvas3D(canvas3d);
	 */
	// attach offscreen canvas to the view
	offscreenCanvas3D = new OffScreenCanvas3D(config);
	offscreenCanvas3D.getScreen3D().setSize(imageWidth, imageWidth);
	offscreenCanvas3D.getScreen3D().setPhysicalScreenHeight(0.5);
	offscreenCanvas3D.getScreen3D().setPhysicalScreenWidth(0.5);
	view.addCanvas3D(offscreenCanvas3D);
	addChild(viewPlatform);
	// turn canvas in front of X axis
	rotateY(-Math.PI / 2);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:38,代码来源:Eye.java

示例3: createViewPlatform

import javax.media.j3d.View; //导入方法依赖的package包/类
void createViewPlatform() {
  // viewplatform
  viewPlatform = new ViewPlatform();
  viewPlatform.setActivationRadius(100f);
  viewPlatform.setViewAttachPolicy(View.NOMINAL_HEAD);
  // view
  view = new View();

  view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
  view.setViewPolicy(View.SCREEN_VIEW);
  view.attachViewPlatform(viewPlatform);
  // physical body
  PhysicalBody phyBody = new PhysicalBody();
  view.setPhysicalBody(phyBody);
  // physical environment
  PhysicalEnvironment phyEnv = new PhysicalEnvironment();
  view.setPhysicalEnvironment(phyEnv);
  // ???? pas compris , pour l'antiliasing
  GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
  template.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
  GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(template);
  // antialiasing
  view.setSceneAntialiasingEnable(true);
  /*
   * to add a onscreen canvas canvas3d = new Canvas3D(config);
   * view.addCanvas3D(canvas3d);
   */
  // attach offscreen canvas to the view
  offscreenCanvas3D = new OffScreenCanvas3D(config);
  offscreenCanvas3D.getScreen3D().setSize(imageWidth, imageWidth);
  offscreenCanvas3D.getScreen3D().setPhysicalScreenHeight(0.5);
  offscreenCanvas3D.getScreen3D().setPhysicalScreenWidth(0.5);
  view.addCanvas3D(offscreenCanvas3D);
  addChild(viewPlatform);
  // turn canvas in front of X axis
  rotateY(-Math.PI / 2);
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:38,代码来源:Eye.java

示例4: createUniverse

import javax.media.j3d.View; //导入方法依赖的package包/类
/**
 * Creates the universe to attach the scenegraph. Used only in the creation
 * phase.
 * 
 * @param ed
 *            the environment description.
 */
private void createUniverse(EnvironmentDescription ed) {
	System.out.println("create Universe");
	// show infos
	Map map = VirtualUniverse.getProperties();
	System.out.println("----------------------------------------");
	System.out.println("j3d.version = " + map.get("j3d.version"));
	System.out.println("j3d.vendor = " + map.get("j3d.vendor"));
	System.out.println("j3d.specification.version = " + map.get("j3d.specification.version"));
	System.out.println("j3d.specification.vendor = " + map.get("j3d.specification.vendor"));
	System.out.println("j3d.renderer = " + map.get("j3d.renderer"));
	System.out.println("J3DThreadPriority = " + VirtualUniverse.getJ3DThreadPriority());
	System.out.println("----------------------------------------");

	createCanvas3D();
	createSceneBranch(ed);

	universe = new VirtualUniverse();

	Locale locale = new Locale(universe);

	// Create and add VIEW branch
	// locale->viewBranch->viewTransformGroup->viewPlatform
	viewBranch = new BranchGroup();
	viewTransformGroup = new TransformGroup();
	viewTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
	viewTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
	Transform3D t3d = new Transform3D();
	t3d.setIdentity();
	viewTransformGroup.setTransform(t3d);
	viewBranch.addChild(viewTransformGroup);

	// Creates View and viewplatform
	viewPlatform = new ViewPlatform();
	viewPlatform.setViewAttachPolicy(View.NOMINAL_HEAD);
	viewPlatform.setActivationRadius(100);
	view = new View();
	view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);

	view.setViewPolicy(View.SCREEN_VIEW);
	view.setVisibilityPolicy(View.VISIBILITY_DRAW_ALL);

	view.setFrontClipDistance(0.02);

	GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
	template.setSceneAntialiasing(GraphicsConfigTemplate.REQUIRED);
	template.setDoubleBuffer(GraphicsConfigTemplate.PREFERRED);
	/*
	 * GraphicsConfiguration config = GraphicsEnvironment
	 * .getLocalGraphicsEnvironment().getDefaultScreenDevice()
	 * .getBestConfiguration(template);
	 */
	// request antialiasing
	view.setSceneAntialiasingEnable(true);

	view.addCanvas3D(canvas3d);
	PhysicalBody phyBody = new PhysicalBody();
	PhysicalEnvironment phyEnv = new PhysicalEnvironment();
	view.setPhysicalBody(phyBody);
	view.setPhysicalEnvironment(phyEnv);
	view.attachViewPlatform(viewPlatform);
	viewTransformGroup.addChild(viewPlatform);

	// Add both branch to the unique locale
	locale.addBranchGraph(viewBranch);
	locale.addBranchGraph(sceneBranch);

	// Add mouse control in the canvas3d
	mouseOrbiter = new MouseOrbiter(canvas3d, viewTransformGroup);

	// sets initial viewpoint
	changeViewPoint(ed.worldViewPoint, null);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:80,代码来源:World.java

示例5: createUniverse

import javax.media.j3d.View; //导入方法依赖的package包/类
/**
 * Creates the universe to attach the scenegraph. Used only in the creation
 * phase.
 * 
 * @param ed
 *          the environment description.
 */
private void createUniverse(EnvironmentDescription ed) {
  System.out.println("create Universe");
  // show infos
  Map map = VirtualUniverse.getProperties();
  System.out.println("----------------------------------------");
  System.out.println("j3d.version = " + map.get("j3d.version"));
  System.out.println("j3d.vendor = " + map.get("j3d.vendor"));
  System.out.println("j3d.specification.version = " + map.get("j3d.specification.version"));
  System.out.println("j3d.specification.vendor = " + map.get("j3d.specification.vendor"));
  System.out.println("j3d.renderer = " + map.get("j3d.renderer"));
  System.out.println("J3DThreadPriority = " + VirtualUniverse.getJ3DThreadPriority());
  System.out.println("----------------------------------------");

  createCanvas3D();
  createSceneBranch(ed);

  universe = new VirtualUniverse();

  Locale locale = new Locale(universe);

  // Create and add VIEW branch
  // locale->viewBranch->viewTransformGroup->viewPlatform
  viewBranch = new BranchGroup();
  viewTransformGroup = new TransformGroup();
  viewTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
  viewTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
  Transform3D t3d = new Transform3D();
  t3d.setIdentity();
  viewTransformGroup.setTransform(t3d);
  viewBranch.addChild(viewTransformGroup);

  // Creates View and viewplatform
  viewPlatform = new ViewPlatform();
  viewPlatform.setViewAttachPolicy(View.NOMINAL_HEAD);
  viewPlatform.setActivationRadius(100);
  view = new View();
  view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);

  view.setViewPolicy(View.SCREEN_VIEW);
  view.setVisibilityPolicy(View.VISIBILITY_DRAW_ALL);

  view.setFrontClipDistance(0.02);

  GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
  template.setSceneAntialiasing(GraphicsConfigTemplate.REQUIRED);
  template.setDoubleBuffer(GraphicsConfigTemplate.PREFERRED);
  /*
   * GraphicsConfiguration config = GraphicsEnvironment
   * .getLocalGraphicsEnvironment().getDefaultScreenDevice()
   * .getBestConfiguration(template);
   */
  // request antialiasing
  view.setSceneAntialiasingEnable(true);

  view.addCanvas3D(canvas3d);
  PhysicalBody phyBody = new PhysicalBody();
  PhysicalEnvironment phyEnv = new PhysicalEnvironment();
  view.setPhysicalBody(phyBody);
  view.setPhysicalEnvironment(phyEnv);
  view.attachViewPlatform(viewPlatform);
  viewTransformGroup.addChild(viewPlatform);

  // Add both branch to the unique locale
  locale.addBranchGraph(viewBranch);
  locale.addBranchGraph(sceneBranch);

  // Add mouse control in the canvas3d
  mouseOrbiter = new MouseOrbiter(canvas3d, viewTransformGroup);

  // sets initial viewpoint
  changeViewPoint(ed.worldViewPoint, null);
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:80,代码来源:World.java


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