Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Rhiojin · Mar 09, 2015 at 11:38 AM · uiimagewebcamtexture

Unity UI. Flip a rawImage?

So I'm working on implementing a hardware camera feature on iOS (possible android too) Due to the many different screen sizes, I need the webCamTexture to scale to fit the screen without distortion(stretched texture). After some failures attempting this with a regular Plane (probably due to faulty code/formulae) it seems that the RawImage.SetNativeSize() method does exactly what I need.

However, the webCamTexture displays in mirrored form. On a plane I could just set the x scale to negative and be done with it. but on a RawImage that just flips the whole plane itself, making it invisible. So is there a way to render the RawImage image flipped? or can anyone supply the necessary code needed to do this with a plane?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Fattie · Feb 29, 2016 at 06:02 PM

I'm pretty sure you have to do it with the simple old

alt text

UVRect.

If I'm not mistaken it is 1-0--1-1 for a vertical mirror flip!!!


screenshot.png (37.5 kB)
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 juliavela · Apr 11 at 01:50 PM 0
Share

THANKS! I had to just change it to -1, 1, it was 1, 1 before!

avatar image
0

Answer by subaiyalafzal22 · Sep 15, 2018 at 09:19 AM

Just rotate th object 180° on y axis in 2d and u will have ur rawimage flipped

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 SpectreCular · Oct 07, 2018 at 07:23 AM 0
Share

Rotation is not synonymous to Image Flipping. What if you wanted the texture rendered on, for example, a convex or concave surface (or virtually any 3D object)? Or what if your image looks like this:

flipped

Use UVs ins$$anonymous$$d, since that's literally what the renderer (Direct3D, OpenGL) is using to map/tile the texture in the first place, even in "2D" (which is actually still 3D, as far as Unity's renderer is concerned).

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Time Code Web Camera Image Capture 1 Answer

With Sliced sprite images (i.e. sprites that are sliced into 9 sections in Sprite Editor), how to make it so that it has a thin border? 1 Answer

Check for Same Image 0 Answers

Setting RawImage's texture by script 0 Answers

Flip WebcamTexture vertically 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