Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am not familiar with 3D graphics, and I'd like to know the right way to render some 2D figures on different points of a wider face of a 3D object. My 3D object is just a cube representing a poker table. I have a 2D png for players' placeholders, and I'd like to render these figures on the 3D object where needed. An alternative solution would be to render the whole face with a big picture containing all the placeholders figures. However, it would be a waste of memory and thus less efficient.

What do you suggest?

share|improve this question
add comment

1 Answer 1

To render on the cube, the images must be used as textures and in Unity that means assigning the images to materials (probably with the Diffuse shader) and assigning the material to the object's MeshRenderer.

However, it's a bit more complicated than that, because the system needs to know how to map the texture to the various vertices in the cube, and there are many different ways to go about this, including merging the various images into one texture, or having multiple textures in one material, etc. There is no right or wrong way, although making all the figures into one image instead of several is usually more efficient, not less efficient, and is likely to use less memory.

Usually the 'easiest' way to set this up is to create the object in a 3D modelling program and export that in a form that Unity can read. However even this is relatively complex for a beginner unfortunately.

share|improve this answer
    
thank for your answer. In my case it can't be more efficient as I just have to duplicate the same png in four different points of the cube and rotate it in two of them. This png is far shorter than the cube face area. I already have the 3D object in Unity as an import from a Blender exported object. I just need to know how to render a small png on four different points of a cube face. –  www.Sillitoy.com Jun 2 '12 at 13:10
    
Worrying about efficiency with a technique you've never used is premature, especially with a maximum of 8 or 16 images? What Kylotan suggests, building 3D objects and placing them in the scene, is the best way forwards. –  Patrick Hughes Jun 2 '12 at 15:11
    
@www.Sillitoy.com: you don't need to do any rotation - you just need to tell the system how to map parts of the image to points on the triangles that make up the cube. Unfortunately that is complex to do by hand which is why it is usually done in the 3D modelling package. –  Kylotan Jun 2 '12 at 15:51
    
Thank you Patrick and Kylotan so you mean I should do that in Blender (for instance) and export the mapping as well. –  www.Sillitoy.com Jun 2 '12 at 16:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.