Loading, updating and rendering of 3d modeling in java

I am new to java 3d. I ran into a situation like: I want to load a finished designed 3d model of any object [as an example of shoes], designed in 3d modeling like 3d studio max or Maya, in my java program, update its texture or color properties and etc., then render it and then display the updated model to the end user.

so I ask all 3d experts how should I go further in order to achieve my goal? which input should be loaded into my program? how can i update the loaded model, display it and display the updated model to the end user?

in a simple story, I want my users to be able to modify the 3d model with their interactions as such, they provide a 3D model of the shoe, for example, in default colors and textures, and also in some fields like the color of the sole if they are chose the color red and then the loaded outsole of the 3D model is colored red (i.e. updated) and then displayed to end users with a rubber outsole in red instead of the default colored shoes.

please advise me to fulfill my goal.

+3


source to share


2 answers


So, first of all, complex objects are usually created using some kind of 3D editing software like Blender or Art of Illusion. These programs can output an object in several different file formats, the most common of which is the .obj file format:

Another common format is .3ds, which in my experience is much more than worth it. They make a .3ds file loader for Java3D, the page can be found here:

My advice for you is to just use the .obj file format, it is much easier to use. You can also just create your own parser, which is not as hard as it sounds. This way you know exactly how your object is loaded into the environment. Java does have its own parser, instructions on how to use it are here:

I had a lot of problems with files exported with Blender when using this file format, unfortunately they may have already fixed the problem, but I'm not sure. When I used a lot more 3D materials, I just used Art of Illusion, I even know that Blender is much more powerful. Blender can be run on a Mac, but is much smoother on properly configured windows. Good luck! If you need some sample code, let me know and I would be more than happy to post some for you.

The art of illusion:



Blender:

I'm not sure how you want the user to be able to modify the object. If you want them to be able to change the color, or the type of shoe, or whatever, that isn't a huge deal. If you want the user to be able to change the length of the lace or anything where you change the actual structure of the object, this requires a deep knowledge of the 3D structure. If you want to change the color, just change the material. If you want to change the type of shoe, just load another shoe. Hope this was helpful to you.

In the comments you also talk about texture mapping, which in my experience is much easier to do in Blender than in Art of Illusion. I would use blender to accomplish this:

John

+4


source


I assume you just want the user to select a different texture / color, right?

Then check out the Java3D tutorials for example. this one: http://www.java3d.org/tutorial.html



My guess is that your shoe is actually a two-piece model, i.e. only the outsole should get a different color, while the rest can get a different texture, right?

In this case, you will need 2 models / figures, each with its own appearance. Then, for example, change the look of the soles as you like, for example. by assigning a different material or changing the color of the material.

+1


source







All Articles