Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by captureint · Jun 20, 2012 at 05:54 PM · textureaspect ratioalignment

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:

alt text

(uploading images seems to be broken on mac using both safari and chrome)

Thanks!

2012-06-20 09.40.06 am.jpg (257.8 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image djm · Jun 20, 2012 at 08:04 PM 0
Share

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. ;-)

avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

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

Aligning a GUI.DrawTexture from the right? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges