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 michellejean · Apr 01, 2013 at 07:42 PM · opengllinesvectrosity

Need the user to be able to draw lines on the screen.

Hi everyone. I have been searching and searching for an answer to my problem high and low and have come up blank. I really hope someone here can point me in the right direction.

I am working on part of a program where the user has to draw on the screen and I have to check their input to make sure it is correct. I actually have all of this working. However the person who owns this program is not happy with my input line. I am using open GL and it draws an itty bitty line which apparently looks like an etch-a-sketch. I have spent the day trying to make my lines thicker and have had zero luck. i have tried using vectrosity and for some reason the lines get wider on the x-z axis and not the x-y axis and I'm pulling my hair out trying to fix it.

I would appreciate any suggestions anyone might have. It doesn't have to be vectrosity and I am using unity pro. Any simple (if possible) ways to have user inputted thicker lines would be help me so much.

Comment
Add comment · Show 1
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 michellejean · Apr 09, 2013 at 08:09 PM 0
Share

Thanks everybody for your responses. I ended up using vectrosity to make the lines. When I initially tried vectrosity and had the lines thickening along the z axis I didn't realize that one of the other cameras in our program was using the x z axis as the front of the screen and for some reason vectrosity was using that camera ins$$anonymous$$d of the camera I thought (I'm still pretty new at this whole unity thing, as well as 3d anything). Anyway once I got Vectrocity using the correct camera it worked wonderfully. I was able to use .Weld and .Fill to get the curved parts of the lines actually looking rounded, ins$$anonymous$$d of looking like a bunch of rectangles spread together.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Yokimato · Apr 01, 2013 at 08:01 PM

Does it need to be an actual line? Or can you cheat by drawing a filled rectangle?

If you use GL.Begin(GL.QUADS);, you can provide rectangle points.

You won't make a THICKER line. A line is 1d, so "thicker" doesn't make sense, that'd make it 2d.

Check out quads though, you can definitely fill in a rectangle. It'd look something like:

         GL.Color (color);
         GL.Begin (GL.QUADS);
         GL.Vertex3 (position.x, position.y, 0);
         GL.Vertex3 (position.x + position.width, position.y, 0);
         GL.Vertex3 (position.x + position.width, position.y + position.height, 0);
         GL.Vertex3 (position.x, position.y + position.height, 0);
         GL.End ();

Not quite it, but you get the idea. Here's the documentation on quads: http://docs.unity3d.com/Documentation/ScriptReference/GL.QUADS.html

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 michellejean · Apr 02, 2013 at 01:43 PM 0
Share

Hi, thanks for the info. However I realized I wasn't specific enough in my question. I shouldn't have said lines because that implies straight lines. I meant curved as well as straight. The user inputs with a stylus or their finger and draws on the screen. I will probably be able to use your info for a different part of my project that actually uses straight lines though so thanks in advance for that.

avatar image Loius · Apr 03, 2013 at 04:29 PM 0
Share

Well, aren't curves just a lot of straight lines with varying direction? I'd think that'd be how you're already drawing them.

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

12 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

Related Questions

GL.LINES disappear if distance z > 1 0 Answers

Draw lines with Vectrosity in the direction transform.forward 1 Answer

Vectrosity lines being distorted when rotated 0 Answers

What is the best way to draw a border around a viewport? 1 Answer

Don't delete discrete lines in Vectrosity 2 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