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 DigitalOranges · May 14, 2011 at 04:19 PM · vectrosity

3D Lines not facing camera

I'm using the wonderful Vectrosity library to draw 3D lines but I have a problem in as much as some of the lines aren't facing the camera.

The camera remains at the world centre (0,0,0) and the lines are created once only at startup and remain in the scene at all times, and they can be drawn anywhere in the world. What I'm seeing is that the line poly normals all seem to face in one direction and not at the camera, which gives the effect of certain lines appearing thinner than others.

Can anyone shed any light on this?

Andy

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 stenfeio · Jan 19, 2017 at 07:05 PM 0
Share

Did you guys get anywhere with this problem?

1 Reply

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

Answer by Eric5h5 · May 14, 2011 at 05:28 PM

You should call DrawLine3D whenever the line or camera moves, usually in Update or LateUpdate. That way the line will always be drawn correctly. (As a side note, in order to help with just this sort of thing, Vectrosity 1.4 has a DrawLine3DAlways function, so that 3D lines are automatically updated for you when necessary, similar to what the VectorManager does. 1.4 isn't out yet.)

Comment
Add comment · Show 10 · 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 DigitalOranges · May 14, 2011 at 05:35 PM 0
Share

I see. Thanks for the response, and do let us all know when 1.4 is ready :-)

avatar image DigitalOranges · May 14, 2011 at 06:29 PM 0
Share

Actually, thinking about it, it seems a bit overkill for me to have to redraw 300 or so lines every Update seeing as the camera position never moves. Is there a way I can adjust your code so when a line is first drawn it's always looking at the camera?

avatar image Eric5h5 · May 14, 2011 at 06:38 PM 0
Share

Not quite sure I understand...if the camera is static, and the lines are static, then nothing has to be redrawn. If the lines change, then they have to be redrawn, but not necessarily in Update, only when they actually change. (Using Update would be typical if the lines are constantly changing, but if that's not the case, just call DrawLine3D only when necessary.)

avatar image Eric5h5 · May 14, 2011 at 06:40 PM 0
Share

To clarify, when a line is first drawn, it is in fact facing the camera. Or at least it's facing a camera; if you have a multi-camera setup, or your camera isn't tagged $$anonymous$$ain Camera, then you should probably use SetCamera3D() to make sure it's set up correctly.

avatar image DigitalOranges · May 14, 2011 at 06:48 PM 0
Share

Yes, I do call setCamera3D (which is a camera that sits at the very centre of the world) before I draw the lines, but they still seem to be facing in strange directions. In one case, I'm drawing a circle around the camera (imagine a horizon line) in 32 segments and it seems that some (but not all) aren't aligned to the camera.

Show more comments

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

1 Person is following this question.

avatar image

Related Questions

How to stop lag between Vectrosity circle and GUI.Label at mouse cursor? 0 Answers

vectrosity: Draw lines with value of float 0 Answers

Vectrosity - lines disappear on certain camera angles 1 Answer

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

How do you select 3d lines in Vectrosity by clicking? 0 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