- Home /
Align texture on object?
What's the best way to align a texture on an object? For example, if I have a plane or a cube and want to drop a jpg onto a face maintaining the aspect ratio. The only thing I'd want to do is scale and position the texture on the object.
The reason I want to do this is to build a nice presentation tool that makes use of high-quality images, positioning them around in 3D space.
For example, the following screen shot shows what happens when I simply create a diffuse material with the selected texture, and then drop it on a plane:
(uploading images seems to be broken on mac using both safari and chrome)
Thanks!
Answer by djm · Jun 20, 2012 at 06:18 PM
This answer might be simplified so I apologize in advance if it does not help. The most accurate way to maintain the aspect ratio of the image is to match the size of the image and the cube or plane. For example if you have a 4x6 image it should maintain the aspect ratio on a 4x6, 2x3 or 8x12 cube or plane. If your working with different aspect ratios between gameObjects and textures, I'm not sure what the best method would be, that's why I try to keep the same ratio.
On a side note, there are also advanced settings in the Inspector window for the texture that can help when enlarging or shrinking an image in the "non Power of 2" drop-down. The Aniso level and the Max Size when increased will help with the quality of the image but at the expense of processing, so you have to balance that out.
Answer by captureint · Jun 20, 2012 at 07:37 PM
How about rotating the image? Like in my screenshot all of my images are coming in rotated clockwise 90 degrees.
What I've noticed is that when importing a texture like a PSD from photoshop the image is place upside down when mapped in Unity on an object. The easiest way for me to avoid this was to rotate the image in Photoshop, opposed to rotating the object in unity. If someone else knows of a better way or could explain why Unity reads image files like this I would like to know the answer too. ;-)
Answer by captureint · Jun 20, 2012 at 07:38 PM
So you would say that the easiest way to get an image into the scene is to use a plane of the same dimensions?
How about rotating the image? As you can see from my screenshot my images are all coming in rotated 90 degrees counter-clockwise.
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Sprite texture flickering. 2 Answers
Aligning Textures in simple planes 1 Answer
Procedural Mesh lines with AA 0 Answers