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 m_bec · Feb 13, 2014 at 04:54 PM · rotationplane

Obtain plane equation from eulerAngles

Hi everyone. I have a plane in the scene that the player can rotate. Based on the plane's euler angles, is there an easy way for me to calculate the coefficients a, b, c, and d of the plane's equation ax+by+cz+d=0?

Thanks!

Comment
Add comment · Show 4
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 whydoidoit · Feb 13, 2014 at 05:01 PM 0
Share

Not based solely on the euler angles - you need a point on the plane (e.g. it's position).

avatar image m_bec · Feb 13, 2014 at 05:04 PM 0
Share

Oh okay. If I have the position and rotation values, how would I go about calculating the coefficients? Thank you!

avatar image robertbu · Feb 13, 2014 at 05:09 PM 0
Share

Not really a Unity question. To get to a Cartesian equation you might want to start with a point and a normal. The point will be the 'transform.position' of the plane. Assu$$anonymous$$g you are talking about a Unity plane object, the normal will be the 'transform.up' of the plane. Then:

http://www.wikihow.com/Find-the-Cartesian-Equation-of-a-Plane

avatar image m_bec · Feb 13, 2014 at 05:43 PM 0
Share

Thanks, all! Exactly the kind of response I needed!

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by whydoidoit · Feb 13, 2014 at 05:34 PM

It's calculated from a point and a vector like this (presuming it's a Unity transform of a Unity Plane);

   a = transform.up.x;
   b = transform.up.y;
   c = transform.up.z;
   d = -Vector3.Dot(transform.up, transform.position);
Comment
Add comment · Show 2 · 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 whydoidoit · Feb 13, 2014 at 05:36 PM 0
Share

If you want to calculate it from an angle and a point then:

     var normal = Quaternion.Euler(yourAngle) * Vector3.up; //Presu$$anonymous$$g the plane faces upwards
     a = normal.x; //etcetera

 
avatar image m_bec · Feb 13, 2014 at 05:43 PM 0
Share

Thank you so much, whydoidoit! Your answer is perfect!

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

19 People are following this question.

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

Related Questions

Camera Scrolling just track the Charakter if z-Rotation=180 0 Answers

Align an axis to a plane 0 Answers

Flip over an object (smooth transition) 3 Answers

I have a game that I want to create a tilted plane in. 1 Answer

Rotate floor plane in-game via C# script 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