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 WinKIller0 · Apr 14, 2013 at 04:31 PM · graphics

How to draw sector to 3D circle

Hello

I'm building a wheel of fortune type game and wondering how to draw sectors and particular draw sectors into circles. I can't find any good solution for our skill level nor any existing code templates for this. The concept for sectors:

  • Sectors that are dynamic (however, for starters even static sectors would be fine)

  • Sectors have to have some kind of filling

  • At the end of the sectors there should be "bars" like in original wheel of fortune

The other stuff is easy enough for me, it's just these damn sectors... So how to draw sectors in 3d space or draw the sectors into 3d circle in Unity scripts?

Comment
Add comment · Show 3
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 robertbu · Apr 14, 2013 at 04:41 PM 0
Share

Typically in Unity, you would "draw" your graphics in Photoshop and then code their rotation and behavior in script. What problem are you trying to solve by drawing in Unity? Would a combined approach work. For example you could draw a blank wheel in Photoshop and then place items on the wheel.

avatar image Hydraxia · Apr 14, 2013 at 04:51 PM 0
Share

and for example you have 12 sectors, every sector has 30 angle ( because the circle is 360 angle ). the first sector is from 0-30 angle, the second from 30 to 60, third from 60-90 etc. When you spin the wheel and it stops, the game gives you money/reward according to the angle. This is only an example

avatar image Eric5h5 · Apr 14, 2013 at 05:27 PM 0
Share

Sounds like you would want to construct the circle using the $$anonymous$$esh class.

1 Reply

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

Answer by TheMaster42 · Apr 14, 2013 at 06:23 PM

Create an empty game object with scripts that will act as your "wheel". In your modeling software, create a "sector" mesh that represents an individual "space" on the Wheel of Fortune wheel, making sure the origin of this mesh is where the center of the wheel would be.

In Maya, you could do this easily by creating a cylinder at the origin (location 0,0,0) whose "top" or "end" has the same number of subdivisions as the number of "sectors" you want your finished wheel to contain. Then, delete all the faces except one, which becomes your wheel piece or "sector." Texture this mesh with the art you want a piece/sector to have, and save a different copy for each possible different kind of piece you want to have appear on your wheel. You could use different colors of pieces to start off simple. Put another way, make one mesh file in your Unity assets folder for each different piece that can exist on your wheel.

Now, you can use Instantiate() to create individual sectors at the same position as your "wheel" GameObject, and change the rotation of each piece to array them around your wheel's origin (something like Quaternion.Euler but there's lots of ways to do it). As Hydraxia pointed out, if you have 12 sectors you want to rotate each 30° from the previous to construct a whole wheel. Since you're choosing which pieces to load each time you Instantiate, you can construct a different wheel dynamically as you wish.

Lastly, if you parent each cloned object to your wheel GameObject (by setting the object's transform.parent) you can simply rotate the wheel GameObject and all the individual sectors will rotate all together as well.

For the "bars" or spokes along the rim that make the clicking noise in the show, just build them into the "sector" model and make sure they're spaced evenly when all the sectors are put together.

If you need more specific examples of how to do any of these steps, let me know and I can include them, but you seemed like you needed a conceptual answer since you're currently trying to draw dynamically onto a circle or something like that. =)

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

14 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

Related Questions

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

Swiping images across the screen - iPhone 0 Answers

Problem with the GUISkin on the script 1 Answer

How can I make an on-screen speedometer? 2 Answers

How do I mask game objects outside of volumetric area 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