本文整理匯總了Java中com.sun.j3d.loaders.Scene類的典型用法代碼示例。如果您正苦於以下問題:Java Scene類的具體用法?Java Scene怎麽用?Java Scene使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。

Scene類屬於com.sun.j3d.loaders包,在下文中一共展示了Scene類的18個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: load

​點讚 3

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Returns the scene described in the given 3DS file.

*/

public Scene load(String file) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException

{

URL baseUrl;

try

{

if (this.basePath != null)

{

baseUrl = new File(this.basePath).toURI().toURL();

}

else

{

baseUrl = new File(file).toURI().toURL();

}

}

catch (MalformedURLException ex)

{

throw new FileNotFoundException(file);

}

return load(new FileInputStream(file), baseUrl);

}

開發者ID:valsr,項目名稱:SweetHome3D,代碼行數:24,

示例2: load

​點讚 3

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Returns the scene described in the given DAE file.

*/

public Scene load(String file) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException

{

URL baseUrl;

try

{

if (this.basePath != null)

{

baseUrl = new File(this.basePath).toURI().toURL();

}

else

{

baseUrl = new File(file).toURI().toURL();

}

}

catch (MalformedURLException ex)

{

throw new FileNotFoundException(file);

}

return load(new BufferedInputStream(new FileInputStream(file)), baseUrl);

}

開發者ID:valsr,項目名稱:SweetHome3D,代碼行數:24,

示例3: setupLighting

​點讚 3

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Setup the worlds lighting. If none is provided in the VRML file then

* we create a simple headlight

*

* @param scene The scene to source the lights from

*/

private void setupLighting(Scene scene) {

Light lights[] = scene.getLightNodes();

if (lights == null) {

BranchGroup lightBG = new BranchGroup();

BoundingSphere lightBounds =

new BoundingSphere(new Point3d(), Double.MAX_VALUE);

DirectionalLight headLight =

new DirectionalLight(new Color3f(1.0f,1.0f,1.0f),

new Vector3f(0,0,-1));

headLight.setCapability(Light.ALLOW_STATE_WRITE);

headLight.setInfluencingBounds(lightBounds);

lightBG.addChild(headLight);

sceneRoot.addChild(lightBG);

}

}

開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:24,

示例4: load

​點讚 3

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Load a scene from the given filename. The scene instance returned by

* this builder will not have had any external references resolved.

* Externprotos, scripts, Inlines and all other nodes that reference part

* of their data as a URL will need to be loaded separately.

*

* @param filename The name of the file to load

* @return A description of the scene

* @throws FileNotFoundException The reader can't find the file

* @throws IncorrectFormatException The file is not one our loader

* understands (VRML 1.0 or X3D content)

* @throws ParsingErrorException An error parsing the file

*/

public Scene load(String filename)

throws FileNotFoundException,

IncorrectFormatException,

ParsingErrorException {

File file = new File(filename);

if(!file.exists())

throw new FileNotFoundException("File does not exist");

if(file.isDirectory())

throw new FileNotFoundException("File is a directory");

InputSource is = new InputSource(file);

return load(is);

}

開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:31,

示例5: succeeded

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

@Override

protected void succeeded(Scene result) {

NeuGenView ngView = NeuGenView.getInstance();

ngView.setScene(s);

ngView.enableButtons();

System.gc();

ngView.outPrintln(Utils.getMemoryStatus());

if (ngView.visualizeData() == null) {

logger.info("is null!");

}

ngView.visualizeData().run();

}

開發者ID:NeuroBox3D,項目名稱:NeuGen,代碼行數:13,

示例6: loadScene

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

private Scene loadScene() throws FileNotFoundException {

IfcScene result;

try {

result = new IfcScene();

SceneManager sceneManager = mapper.map(configuration);

mapper = null; // release resources

result.setSceneGroup(sceneManager.getScene());

sceneManager.animate();

} catch (TargetCreationException e) {

throw new ParsingErrorException(e.getMessage());

}

return result;

}

開發者ID:hlg,項目名稱:billie,代碼行數:14,

示例7: loadWavefrontObject

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Chargement de l'objet Wavefront (masque.obj) ainsi que les materiaux qui

* lui sont associes

*

* @param filename nom du fichier de l'objet a charger

* @return BranchGroup branch group contenant l'objet Wavefront

*/

private static BranchGroup loadWavefrontObject(String filename) {

ObjectFile waveFrontObject = new ObjectFile();

Scene scene = null;

try {

scene = waveFrontObject.load(filename);

BranchGroup bg = scene.getSceneGroup();

return bg;

} catch (Exception e) {

e.printStackTrace();

}

return null;

}

開發者ID:IGNF,項目名稱:geoxygene,代碼行數:29,

示例8: parseStream

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Returns the scene with data read from the given 3DS stream.

*/

private Scene parseStream(ChunksInputStream in) throws IOException

{

this.masterScale = 1;

this.meshes = new ArrayList();

this.materials = new LinkedHashMap();

this.meshesGroups = new HashMap>();

boolean magicNumberRead = false;

switch (in.readChunkHeader().getID())

{

case M3DMAGIC:

case MLIBMAGIC:

case CMAGIC:

magicNumberRead = true;

while (!in.isChunckEndReached())

{

switch (in.readChunkHeader().getID())

{

case M3D_VERSION:

in.readLittleEndianUnsignedInt();

break;

case EDITOR_DATA:

parseEditorData(in);

break;

case KEY_FRAMER_DATA:

parseKeyFramerData(in);

break;

default:

in.readUntilChunkEnd();

break;

}

in.releaseChunk();

}

break;

case EDITOR_DATA:

parseEditorData(in);

break;

default:

if (magicNumberRead)

{

in.readUntilChunkEnd();

}

else

{

throw new IncorrectFormatException("Bad magic number");

}

}

in.releaseChunk();

try

{

return createScene();

}

finally

{

this.meshes = null;

this.materials = null;

this.meshesGroups = null;

this.root = null;

}

}

開發者ID:valsr,項目名稱:SweetHome3D,代碼行數:65,

示例9: load

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Returns the scene described in the given OBJ file stream.

*/

public Scene load(Reader reader) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException

{

return load(reader, null);

}

開發者ID:valsr,項目名稱:SweetHome3D,代碼行數:8,

示例10: parseObjectStream

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Returns the scene parsed from a stream.

*/

private Scene parseObjectStream(Reader reader, URL baseUrl) throws IOException

{

this.vertices = new ArrayList();

this.textureCoordinates = new ArrayList();

this.normals = new ArrayList();

this.groups = new LinkedHashMap();

this.currentGroup = new Group("default");

this.groups.put("default", this.currentGroup);

this.currentMaterial = "default";

this.appearances = new HashMap(DEFAULT_APPEARANCES);

StreamTokenizer tokenizer = createTokenizer(reader);

while (tokenizer.nextToken() != StreamTokenizer.TT_EOF)

{

switch (tokenizer.ttype)

{

case StreamTokenizer.TT_WORD:

parseObjectLine(tokenizer, baseUrl);

break;

case StreamTokenizer.TT_EOL:

break;

default:

throw new IncorrectFormatException(

"Unexpected token " + tokenizer.sval + " at row " + tokenizer.lineno());

}

}

try

{

return createScene();

}

finally

{

this.vertices = null;

this.textureCoordinates = null;

this.normals = null;

this.groups = null;

this.appearances = null;

}

}

開發者ID:valsr,項目名稱:SweetHome3D,代碼行數:44,

示例11: getScene

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

public Scene getScene() {

return s;

}

開發者ID:NeuroBox3D,項目名稱:NeuGen,代碼行數:4,

示例12: setScene

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

public void setScene(Scene scene) {

this.scene = scene;

}

開發者ID:NeuroBox3D,項目名稱:NeuGen,代碼行數:4,

示例13: VisualizationTask

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

public VisualizationTask(Application application, Visualization vis, Scene s) {

super(application);

this.vis = vis;

this.s = s;

}

開發者ID:NeuroBox3D,項目名稱:NeuGen,代碼行數:6,

示例14: load

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

public Scene load(Reader reader) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException {

throw new UnsupportedOperationException();

}

開發者ID:hlg,項目名稱:billie,代碼行數:4,

示例15: loadFile

​點讚 2

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Load the given file into the scene.

*

* @param filename The name of the file or the URL to load

*/

private void loadFile(String file) {

int flag = VRML97Loader.LOAD_ALL;

if(staticLoad)

flag &= ~VRML97Loader.LOAD_BEHAVIOR_NODES;

VRML97Loader loader = new VRML97Loader(flag);

// if the file is a directory, ignore it

File f = new File(file);

if(f.exists() && !f.isFile()) {

System.out.println("Can't load directories specified");

System.exit(1);

}

URL url = null;

Scene scene = null;

try {

url = new URL(file);

} catch (MalformedURLException badUrl) {

// if the location is not a URL, this is what you get

}

try {

if(url != null)

scene = loader.load(url);

else

scene = loader.load(file);

} catch(Exception e) {

System.out.println("Exception loading URL:" + e);

e.printStackTrace();

System.exit(0);

}

urlLabel.setText("File " + file);

if (scene != null) {

// get the scene group

sceneGroup = scene.getSceneGroup();

sceneGroup.setCapability(BranchGroup.ALLOW_DETACH);

sceneGroup.setCapability(BranchGroup.ALLOW_BOUNDS_READ);

sceneGroup.compile();

// add the scene group to the scene

examineGroup.addChild(sceneGroup);

// now that the scene group is "live" we can inquire the bounds

setViewpoint();

setupLighting(scene);

}

}

開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:59,

示例16: Loader3D

​點讚 1

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Chargement de l'objet Wavefront (masque.obj) ainsi que les materiaux qui

* lui sont associes

*

* @param filename nom du fichier de l'objet a charger

* @return BranchGroup branch group contenant l'objet Wavefront

*/

private static BranchGroup Loader3D(String filename) {

Loader3DS d = new Loader3DS();

if (!Manager3DS.TEXTURED) {

d.noTextures();

}

Scene scene = null;

try {

String path = filename;

scene = d.load(path);

BranchGroup bg = scene.getSceneGroup();

return bg;

} catch (Exception e) {

System.out.println(filename);

e.printStackTrace();

}

return null;

}

開發者ID:IGNF,項目名稱:geoxygene,代碼行數:35,

示例17: ObjectLoader

​點讚 1

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

public ObjectLoader() {

setLayout(new BorderLayout());

GraphicsConfiguration graphicsConfig = SimpleUniverse

.getPreferredConfiguration();

Canvas3D canvas3D = new Canvas3D(graphicsConfig);

add(canvas3D);

canvas3D.setSize(1200, 800);

canvas3D.setVisible(true);

BranchGroup scene = new BranchGroup();

ObjectFile loader = new ObjectFile(ObjectFile.LOAD_ALL);

loader.setFlags(ObjectFile.RESIZE);

Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);

BoundingSphere bounds =

new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);

Vector3f light1Direction = new Vector3f(2.0f, 12.0f, -12.0f);

DirectionalLight light1

= new DirectionalLight(light1Color, light1Direction);

light1.setInfluencingBounds(bounds);

scene.addChild(light1);

Scene modelScene = null;

try {

modelScene = loader.load("Images/gargoyle.obj");

} catch (Exception e) {

}

scene.addChild(modelScene.getSceneGroup());

SimpleUniverse universe = new SimpleUniverse(canvas3D);

universe.getViewingPlatform().setNominalViewingTransform();

universe.addBranchGraph(scene);

ViewingPlatform viewPlatform = universe.getViewingPlatform();

TransformGroup viewTransform = viewPlatform.getViewPlatformTransform();

Transform3D t3d = new Transform3D();

viewTransform.getTransform(t3d);

t3d.lookAt(new Point3d(0, 0, 4), new Point3d(0, 0, 0), new Vector3d(0, 1, 0));

t3d.invert();

viewTransform.setTransform(t3d);

}

開發者ID:GettingNifty,項目名稱:Heavy-Evil,代碼行數:58,

示例18: modelFromFile

​點讚 1

import com.sun.j3d.loaders.Scene; //導入依賴的package包/類

/**

* Helper method to create model from .obj file.

*

* @param modelFile file name

* @throws java.io.FileNotFoundException

*/

protected void modelFromFile(String modelFile) throws FileNotFoundException {

ObjectFile objectFile = new ObjectFile();

Scene scene = objectFile.load(modelFile);

transformGroup.addChild(scene.getSceneGroup());

}

開發者ID:DrTon,項目名稱:jMAVSim,代碼行數:12,

注:本文中的com.sun.j3d.loaders.Scene類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

java scene_Java Scene類代碼示例相关推荐

  1. java uiautomation_Java UiAutomation類代碼示例

    本文整理匯總了Java中android.app.UiAutomation類的典型用法代碼示例.如果您正苦於以下問題:Java UiAutomation類的具體用法?Java UiAutomation怎 ...

  2. java nifty_Java NiftyDialogBuilder類代碼示例

    本文整理匯總了Java中com.gitonway.lee.niftymodaldialogeffects.NiftyDialogBuilder類的典型用法代碼示例.如果您正苦於以下問題:Java Ni ...

  3. java intfunction_Java IntFunction類代碼示例

    本文整理匯總了Java中java.util.function.IntFunction類的典型用法代碼示例.如果您正苦於以下問題:Java IntFunction類的具體用法?Java IntFunct ...

  4. java sentence_Java Sentence類代碼示例

    本文整理匯總了Java中aima.core.logic.propositional.parsing.ast.Sentence類的典型用法代碼示例.如果您正苦於以下問題:Java Sentence類的具 ...

  5. java notifier_Java Notifier類代碼示例

    本文整理匯總了Java中org.apache.maven.model.Notifier類的典型用法代碼示例.如果您正苦於以下問題:Java Notifier類的具體用法?Java Notifier怎麽 ...

  6. java bidi_Java Bidi類代碼示例

    本文整理匯總了Java中java.text.Bidi類的典型用法代碼示例.如果您正苦於以下問題:Java Bidi類的具體用法?Java Bidi怎麽用?Java Bidi使用的例子?那麽恭喜您, 這 ...

  7. java linest_Java STLineSpacingRule類代碼示例

    本文整理匯總了Java中org.docx4j.wml.STLineSpacingRule類的典型用法代碼示例.如果您正苦於以下問題:Java STLineSpacingRule類的具體用法?Java ...

  8. java datarow_Java DataRow類代碼示例

    本文整理匯總了Java中org.apache.cayenne.DataRow類的典型用法代碼示例.如果您正苦於以下問題:Java DataRow類的具體用法?Java DataRow怎麽用?Java ...

  9. java hessian2_Java Hessian2Output類代碼示例

    本文整理匯總了Java中com.caucho.hessian.io.Hessian2Output類的典型用法代碼示例.如果您正苦於以下問題:Java Hessian2Output類的具體用法?Java ...

最新文章

  1. Java序列化的作用和反序列化
  2. Java 必须掌握的 12 种 Spring 常用注解!
  3. Git指南-Git-flow开发流程
  4. 外包程序员入职蚂蚁金服被质疑,网友:人生污点
  5. 子矩阵(NOIP2014 普及组第四题)
  6. 【转载】那么明亮的sz4j
  7. 关闭java程序脚本-linux
  8. 【图像计数】基于matlab灰度二值化同类物体简单计数【含Matlab源码 759期】
  9. linux红帽认证管理员,红帽(Red Hat)面向企业开发人员和应用管理员的认证
  10. 微软ewf不还原注册表_Microsoft大胆计划将功能区还原回工具栏
  11. python3.7下载 numpy
  12. 海康摄像头ffmpeg推流到srs流媒体服务器
  13. java定时器定时发短信,定时任务(如:定时发送短信信箱等)
  14. mouse without borders 一套键鼠控制多台设备
  15. 代码传奇 张一鸣的成长之路
  16. 福大软工 · 第七次作业 - 需求分析报告
  17. corutine rust_rust 异步 IO:从 mio 到 coroutine
  18. java 朋友圈分享接口_微信发朋友圈api接口调用代码
  19. linux远程主机拒绝连接,linux – Telnet [无法连接到远程主机:拒绝连接]
  20. 别踩白块儿 开源免费(C++)

热门文章

  1. git命令超实用集齐
  2. Java 接口中使用数组缺点的理由
  3. 模糊逻辑学习--建立Mamdani系统(GUI)
  4. 4g内存电脑装xp系统怎么样_系统坏了?去店了重装系统又贵?今天手把手教你如何重装系统...
  5. python pdb pip安装_Python调试器,一个优秀开发人员的必备技能包
  6. 笔记本电脑投屏到电视_电脑怎么投屏到电视?掌握这3个方法就够了
  7. 树莓派3B wiringPi 控制LED小灯
  8. Day06,selenium的剩余用法、万能登录破解和爬取京东商品信息,及破解极验滑动验证码...
  9. ThinkJS框架入门详细教程(二)新手入门项目
  10. SQLite剖析之事务处理技术