Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 john1995 · Nov 30, 2016 at 08:00 AM · c#unity 2dverticestriangulation

how to do a delaunay triangulation for 10 points using c#?

Hi, I'm a noob ,just wanted to know how to triangulate some set of points . also I searched and found as3implementation but I was not able to make anything sensible out of it because I know only the basics of coding and know nothing about importing libraries. Can someone please show me the right way to go about it.

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 chillersanim · Nov 30, 2016 at 09:38 AM 2
Share

This question will most likely not attract many helpfull answers.
In order to be of any help, we would need this information:

  • What exactly do you want to achieve (triangulation or delaunay triangulation)

  • What input data do you have, what assumptions can we make about it (planar vs. pointcloud)

  • What have you tried so far (example codes, libraries you've looked at, etc.)

  • What is the exact question you want answered

Your question is to broad as it is.
If you need help finding a suitable library, then ask that.
Or when you need help using a specific library, then ask that.
But if you need a finished implementation of delaunay triangulation with description on how it works, etc. then don't ask it, as nobody will have the time to do that.

If you need a working system, you should take a look at Unity Connect.

avatar image Mikael-H chillersanim · Nov 30, 2016 at 10:04 AM 0
Share

Even though I answered, I agree with all of the above :)

avatar image john1995 chillersanim · Nov 30, 2016 at 10:05 AM 0
Share
  • require delaunay triangulation

  • have some points(random) on a unity 2d layer.

  • was not able to try anything because it was too advanced for me

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Mikael-H · Nov 30, 2016 at 10:02 AM

If you don't know much about coding then an implementation of a triangulating algorithm might be out of your reach. Thus I would recommend importing an existing solution. Actually, that would be my recommendation anyway.

There are several implementations of Delaunay triangulation in c# available.

csDelaunay is one and its use seems to be described in this forum discussion

Triangle.NET is another that I have used previously but should read this before using it. It works great if you just handle the mono 2.0 fix.

EDIT:

Just realized that the first link was actually generating a voronoi diagram, the duality of a delaunay triangulation. For conversion see delaunay from voronoi

or use one of these maybe:

Unity-Delaunay

C# - Simple Voronoi/Delaunay Diagrams For Starters

Comment
Add comment · Show 3 · 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 john1995 · Nov 30, 2016 at 11:36 AM 0
Share

hi , I managed to import the csDelaunay library , but I cant understand how I will use it to make a planar graph using delaunay triangulation. I have 7-10 points in 2d .I require to connect them with line game objects (sprites) using delaunay triangulation. Could you please show me what are the steps I should follow. I will attach the code I used to draw lines if that could be of any use.

avatar image john1995 john1995 · Nov 30, 2016 at 11:40 AM 0
Share
 void Draw_Line (Transform point1, Transform point2)
 {
     
     lines_list.Add(new LINES(  (GameObject)Instantiate(line_prefab) , point1 , point2   ));
     lines_list[line_count].prefab.name = point1.name+"-"+point2.name;
     Line_pos (point1,point2,line_count);
     line_count++;

     } 


 void Line_pos (Transform point1, Transform point2,int index)
 {

     lines_list[index].prefab.transform.position = (point1.position + point2.position) / 2f;
     Vector3 moveDirection = point1.transform.position - point2.transform.position;



     float angle = $$anonymous$$athf.Atan2 (moveDirection.y, moveDirection.x) * $$anonymous$$athf.Rad2Deg;
     lines_list[index].prefab.transform.rotation = Quaternion.AngleAxis (angle, Vector3.forward);
     lines_list[index].prefab.transform.localScale = new Vector3 (moveDirection.magnitude / 4f, 1f, 1f);

 } 
avatar image Mikael-H john1995 · Nov 30, 2016 at 04:30 PM 0
Share

oh, sorry just realized that it produces a voronoi diagram... It can be converted to a triangulation, but if that is too hard maybe you better use one of the alternatives. I added two alternatives that might work. I have only tried Triangle.NET but that requires you to follow the instructions in the link.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Cinemachine follow Player but also focus on trajectory 0 Answers

Brackeys EnemyAi Script 0 Answers

Get Random Number for each player from Dice 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