Reset Texture of Model Runtime

Hi

I am very new to JME3 so this might be a ridiculous question.

For example ,

I start A SImpleApplication child class with one model and applied texture in swing canvas.

I have one button as well in the swing canvas in different Panel.

Now what i want to do is whenever i press this button , the Program should pickup randomly any UV mapped Texture for this model from specified directory and apply this texture to this model at runtime.

any other thing i can manage, i have launched model with default Texture already , now please anyone can tell me how can i change this texture run time ?

Thanks

Have you read through and/or done all of the tutorials? That will get you almost all the way there.

HI

i did but i might not get the concept.

could you please provide the specific sample of code or tutorial ?

second i want to reload / restart from sing canvas.

Thanks
Mihir parekh

The material tutorial covers textures etc.

Hi Zarch

why don’t you give me speicific link or code samples ?

when i restart my simple application class from Jbutton’s action event the application gives me an error like can not start application from EDT .

will you please help ?

Thank You
Mihir

@mihir said: Hi Zarch

why don’t you give me speicific link or code samples ?

when i restart my simple application class from Jbutton’s action event the application gives me an error like can not start application from EDT .

will you please help ?

Thank You
Mihir

You have jumped into the deepest end of the pool without knowing how to swim and now are asking us what to do with your hands. We are trying to teach you how to swim… which will require that you get out of the deepest end of the pool and head to shallower waters for a while. You do not yet have the skills to start where you are.

You don’t know how to call JME code from separate threads. (advanced threading)
You don’t know how to set a texture on a material.
You don’t know how to traverse the scene graph to find the materials.

Doing all of the tutorials and learning the fundamentals will help.

Otherwise, if you need me to write some code for you then I can quote you my contractor rates. I think others’ rates will be cheaper, though.

@zarch
@pspeed

after so many reading and experimenting i have successfully accomplish my goal as i was expecting.

again there is no answer from this forum.

Thanks
Mihir

@mihir said: @zarch @pspeed

after so many reading and experimenting i have successfully accomplish my goal as i was expecting.

again there is no answer from this forum.

Thanks
Mihir

We wrote and (try to) keep the tutorials up to date so that we don’t have to teach every poster the basics and answer the same simple questions 10 times a day.

Glad you finally found what you were looking for.

@mihir said: after so many reading and experimenting i have successfully accomplish my goal as i was expecting.

again there is no answer from this forum.

So you got help, complain that the help isn’t useful without saying what would have helped (hey, we can’t read minds), and finally say you solved it without posting what exactly your path was so that we can’t even help the next person with the same problem.

Well done, Sir, well done.