Hi,
Need help I want to have two static images on this 3D apple model (this model is working fine with provided texture), one image will be displaying on front and second image will display when hover or click on the model.
Here is a basic fiddle that shows how a texture is changed when the respective mesh is hovered with the mouse. As you can see, raycasting is used to implement the interaction:
Thank you so much Michael for your reply.
But I want to add two images on a 3D model one will always showing and other will be showing when hover 3D Model, so that images will look like a part of that 3D model.
Do you mean show one or both, but not the second alone? @Mugen87’s answer shows how you can change texture on a single material. A texture will, as you describe, look like a part of the 3D model. But the model needs to have texture coordinates defined.
An alternative if you need to render both texture at the same time, will be to use rendergroups on the geometry and multiple materials on the same mesh (passing an array of materials to the constructor). Typically, you will then enable or disable the second material depending on the intersection state. The render groups will both contain all elements of the geometry. The two materials will have one texture each.
I don’t think you have to work with BufferGeometry.groups. You can also use SceneUtils.createMultiMaterialObject(). Just pass in your geometry and the respective materials (with different textures).
Checking the linked source, I notice that the function will create one mesh per material. Will the renderer reuse the geometry with negligible overhead?
spheres are not geometry anymore as you can see code i have posted with question. It’s already created with MTLLoader and OBJLoader so how can i add materials (with different textures)?