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
1
Question by Comaleaf · Apr 19, 2012 at 11:21 PM · guiquaternionmatrix

GUI clipping with 3D matrix

(Same problem as this question I believe, but that question received no response)

I'm trying to draw a label at a 3D skew. Searching around I found this question where the answers state:

GUI.matrix lets you translate the 2D planes that is GUI in three dimensions.

and

While it cannot be positioned in 3d space, it can be rotated in all 3 dimensions using the GUI.Matrix.

So I figured GUI.matrix is the solution I need...

However, when I attempt this I get strange clipping issues on the label. I've attempted to change the text clipping on the GUI style but that makes no difference.

This is my code:

 #pragma strict
 
 var guiStyle : GUIStyle;
 
 function OnGUI () {
     GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, 0), Vector3.one);
 
     if (guiStyle)
         GUI.Label(Rect (200,200,500,500), "I am a label", guiStyle);
 }

Using Quaternion.Euler(0, 0, 0) as above, produces this correct output:

alt text

Using Quaternion.Euler(6, 5, 0) (for example), produces:

alt text

Most other values don't show up at all, or show up with varying degrees of clipping.

What am I doing wrong?

Screen Shot 2012-04-20 at 00.10.10.png (6.4 kB)
Screen Shot 2012-04-20 at 00.09.02.png (7.7 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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by thtgy2048 · Apr 01, 2013 at 05:49 PM

I have some answer, but not a solution after some experimentation. Basically I wanted the same effect that used in the GUI for Crysis 3, where it rotates on the Y axis based on the mouse position. So rotating on the Y and X Axis in Unity creates clipping effects very quickly. After playing around with the translation also, it appears that Unity clips the Z plane for values less than 1 and greater than 100. Unity is counting pixels as units in the z plane, so if you have a GUI element that is 400 pixels wide, its starts to clip very quickly as it is rotated. Does anyone have a way of changing the clipping of the GUI in the z plane, or performing the rotation, then scaling the result?

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Setting Scroll View Width GUILayout 1 Answer

Advanced Orbit Camera Around Target 1 Answer

Deduct health on collision 2 Answers

GUI Text Enter Name 3 Answers


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