简体   繁体   English

Java 3d和纹理mappig

[英]Java 3d & Texture mappig

I am trying to load a 3D scene into java3D . 我正在尝试将3D场景加载到java3D中。 I've tried to load my scene created in Cinema 4D in multiple formats (Obj, wrl, 3ds, x3d) but thus far I haven't been able to transport my textures with it. 我已经尝试以多种格式(Obj,wrl,3ds,x3d)加载在Cinema 4D中创建的场景,但是到目前为止,我还无法使用它来传输纹理。 The most promising up to now is vrml because at least one texture is being integrated. 到目前为止,最有前途的是vrml,因为已集成了至少一个纹理。 All other formats don't support textures or at least don't load them. 所有其他格式都不支持纹理,或者至少不加载它们。

Is there a way to create a 3D scene with multiple materials & textures and export them in a way that I can load them right away in java3d? 有没有一种方法可以创建具有多种材质和纹理的3D场景并以可以立即将它们加载到java3d中的方式导出它们? Is there even such a format supported? 是否支持这种格式? (Right now I blame my texture problems with vrml on the poor export of c4d) (现在,我将vrml的纹理问题归咎于c4d的不良出口)

How is this done in general? 一般情况下如何进行? Do I have to apply my textures by hand in java code? 我是否必须在Java代码中手动应用纹理? This seems kind of odd to me, I have only been able to apply one texture to the whole loded object, since java3d seems to handle everything in my scene as one shape. 这对我来说似乎很奇怪,我只能将一个纹理应用于整个对象,因为java3d似乎可以将场景中的所有内容作为一个形状来处理。 Do I have to load every object in my scene separately and "reconstruct" the complete scene via code? 我是否必须分别加载场景中的每个对象并通过代码“重建”整个场景?

Any thoughts on this or links to frameworks that ease the pain are appreciated! 任何对此想法或减轻痛苦的框架的链接都表示赞赏!

Cheers, Corelgott 干杯,Corelgott

Which importer or loader are you using? 您正在使用哪个进口商或装载者?

Did you try InteractiveMesh's free XModelImporter for X3D files : http://www.java.net/node/706300 . 您是否尝试过InteractiveMesh的X3D文件免费XModelImporter: http : //www.java.net/node/706300 Can you make a test C4D-export (obj and/or x3d) inclusive textures available for download, so I can check it? 您可以下载包含C4D导出(obj和/或x3d)的测试纹理供我下载吗? InteractiveMesh will soon release a new Java 3D OBJ importer. InteractiveMesh即将发布新的Java 3D OBJ导入器。

August 八月

The ObjectFile-Loader is able to load textures. ObjectFile-Loader能够加载纹理。 Check the corresponding '.mtl' file for the tokens 'map_Kd' which provide the path for the (diffuse) texture image. 在相应的.mtl文件中检查标记“ map_Kd”,这些标记提供了(漫反射)纹理图像的路径。 These paths must be relative to the location of the '.obj' file. 这些路径必须相对于“ .obj”文件的位置。 The supported image formats are: bmp, gif, jpg, png. 支持的图像格式为:bmp,gif,jpg,png。

Give following conversion tools a try: 尝试以下转换工具:

Also check in the exported '.x3d' files the XML elements if the paths are relative and correct. 如果路径是相对和正确的,还请检查导出的“ .x3d”文件中的XML元素。

Otherwise wait for the release of InteractiveMesh's ObjShapeImporterJ3D planned for the next week. 否则,请等待下周计划发布InteractiveMesh的ObjShapeImporterJ3D。 Or, if possible, provide me a download link or send all files (obj, mtl, 3ds, and textures) to info [at] interactivemesh [dot] com. 或者,如果可能,请提供下载链接或将所有文件(obj,mtl,3ds和纹理)发送到info [at] interactivemesh [dot] com。 As an Easter gift I would try to find the issues and convert the files to x3d. 作为复活节礼物,我将尝试查找问题并将文件转换为x3d。

August 八月

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM