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 juan-jo · Sep 16, 2010 at 07:12 AM · rotationshadertexturepivot

sphere texture rotation around pivot (eye)

I'm trying to rotate an eye texture, with sphere projection, around the eye's center.

A similar subject is discussed earlier in this thread, and there is mentioned the need to position the pivot point for the rotation.

I've done several more complex tests, but does not make sense to make it more complicate if I can't make it work with the eye in the center of the world.

Can anyone help me to make it work in this simplified attached project?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Paulius-Liekis · Sep 20, 2010 at 08:57 AM

Are you sure you need to use transformation of texture coordinates instead of transformation of the object itself? i.e. why can't you rotate the sphere itself?

As far as your code goes it does exactly what it written to do :) If was making eye movements in this way I would just two away rotation and just use X and Y offsets, because they do what you want them to do - move eye up/down and left/right. Except that there is one problem - when you move it up/down the iris (it that correct word) gets squeezed, because of texture is mappen on a spehere, but there is nothing you can do about it - there is always deformation when you map texture to a sphere.

BTW: if you need just texture offset there is such property on a material (I thinkg it is called textureOffset, and there are textureScale and textureRotation IIRC), but I'm not sure they work with custom shaders.

Another thing: your eye is misaligned even when game is not running - mare sure the iris is aligned with one of the axis when no offset is set.

If this doesn't answer your question, could you give more details: what kind of result do you expect? some screenshots/drawings would help.

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

No one has followed this question yet.

Related Questions

LineRenderer unchanging texture rotation 0 Answers

Offset textures individually into specific world directions 2 Answers

Assigning a texture to a black & white "alpha mask" 2 Answers

Why is my UV'd texture displaying wrapped with the wrong scale? 0 Answers

Black Texture on Initial Load 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