APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Issue Applying textures to 3D models post and replies

Return to the Issue Applying textures to 3D models thread
Login to post to this thread

Issue applying textures to 3D objects
Jorge Vila Tomás
3 Posts

Hi!
I've been trying to apply different textures to different 3D objects in EJS but I keep getting the same problem everytime I do it:
I add the texture in .jpg or .png to each different object but when I export the simulation, the texture doesnt appear and I just get the object with it's base colour.

I don't know if this is an image format problem or I'm doing something wrong, but I'd appreciate any help provided.

Thank you very much for your attention.


Replies to Issue applying textures to 3D objects

Re: Issue applying textures to 3D objects -
Francisco Esquembre
228 Posts

Hi,
I would need a simple example that reproduces the problem to inspect it in detail.
My only suggestion now is that you make sure that the texture files are located in the same directory (or in a subdirectory of it) as the simulation file.
Maybe EJS does not find it when it packs the simulation...

Paco



Re: Re: Issue applying textures to 3D objects -
Jorge Vila Tomás
3 Posts

I didn't get any errors regarding missing files during the compilation, so I imagine EJS can find the texture file.

I made a simple example reproducing the issue and packed it into a .rar file and attached it to the post.

Thanks for the quick response and the interest.

Attached File: Metal.rar



Re: Re: Re: Issue applying textures to 3D objects -
Francisco Esquembre
228 Posts

Jorge,

Textures only work in the JAVA3D Implementation of the DrawingPanel3D. And you need o install Java3D in your computer.

Unless you need to use Java, I suggest that hyoid use the JavaScript 'flavour' of EjsS. Its support for 3d is better.

Paco



Re: Re: Re: Re: Issue applying textures to 3D objects -
Jorge Vila Tomás
3 Posts

I knew it was something obvious!

Thank you very much, Paco.



Re: Re: Re: Re: Re: Issue applying textures to 3D objects -
lookang Avatar
lookang
222 Posts

try this ejss version of the same textureURL.
enjoy!

Attached File: ejss_src_Metal.zip


OSP@SG blog
OSP@SG Digital Library


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book