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 LethalJam · Dec 15, 2014 at 09:50 AM · meshverticestrianglesfog of warray-casting

Lighting up all triangles between two points in a mesh?

Ok, so I'm working on a type of fog of war that's supposed to simulate the vision from a point, so that you can't see through walls an so forth. This picture might help to explain: alt text

I cast rays in 8 directions (Perhaps not the final amount) and detect the walls and illuminate the triangle in the plane where the ray hit the wall. All I want to do now is to illuminate the areas between these triangles. What would be the best way to do this? I've thought about it for some time but I can't come to a solution. I'll be thankful for every bit of help I can get, thanks!

as.png (57.9 kB)
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 LethalJam · Dec 17, 2014 at 05:19 PM 0
Share

Bump. I really need some help here :<

avatar image LethalJam · Jan 05, 2015 at 01:05 PM 0
Share

Thanks for the tips but you should have posted this in anwsers so that I could have marked it as a correct anwser! Thanks!

avatar image richyrich · Jan 05, 2015 at 02:13 PM 0
Share

Comment converted :)

1 Reply

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

Answer by richyrich · Dec 17, 2014 at 06:53 PM

Here's a hack for you until you find something better :)

Let's assume all the triangles like to place tennis, so between all the points on the triangles, place a plane pointing upwards. Now RaycastAll from the current position across all the tennis nets (planes). For all the hits, record the triangle that it is connected to. Now just go through your triangles and light them up.

I say its a hack - a better answer is probably to go find yourself code that works out line segment to line segment intersection, then use the triangle vertices as the points for each line segment (like the nets). Of course, most examples online will likely be right hand coordinate while Unity is left hand so you'd need to replace y changes with z for 3D verts. Enjoy :D

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Best Way to Link Vertices into Mesh 0 Answers

Null Reference Exception Assigning Vertices to Mesh 0 Answers

Best way to optimize mesh updating through code? 1 Answer

Can you apply smoothing to split vertices on a generated mesh? 1 Answer

Get an specific vertices of a mesh 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