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 jfbguy · Jul 02, 2013 at 03:34 PM · meshvector3vector2triangles

2D Vectors along 3D Triangle

alt text

So I thought I should include this picture to demonstrate what I've been trying to figure out how to do, but not having any luck googling, checking answers, boards, etc.

V1-V5 are Vector3's

A,B,C are Vector2's

So I'm trying to split a triangle along a certain path.

V4 is the starting Vector3

A is the starting Direction

I want to askew A according to B to get C, (adding them then normalizing, easy)

And using C from V4 to find the intersection point V5 giving a length (this will be tested to find if/which edge the resulting vector hits. This is on a Mesh, so I have access to the normals of V1,V2, and V3, so I feel like I should be able to bring the problem down to 2 dimensions, then bring it back to 3D once I have the answer.... but I'm not sure. Anyone have any ideas?

problem.jpg (42.3 kB)
Comment
Add comment · Show 7
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 Seregon · Jul 02, 2013 at 04:11 PM 1
Share

As I understand this, you want to find the point at which the line V4 + C intersects the line V1->V2. You've not explained what the vectors A, B, and C are, so I'm not sure if V4 + C is in the same plane as the triangle?

If they are in the same plane, its a simple case of calculating that intersection. If they're not, then they won't intersect, and perhaps that's why your asking about doing it in 2D? In that case you first need to project the vector C into the plane of the triangle, and then intersect. If you can clarify that, I'll see if I can help with the actual math.

avatar image jfbguy · Jul 02, 2013 at 04:15 PM 0
Share

Like in the question, A,B,C are Vector2's. I'm trying to use them as directional vector's along the triangle plane. They have no depth, so yes, they will be on the plane. $$anonymous$$ind of like how UVs (2D Vectors) are used to map textures on 3D triangles. And yes, that is precisely what I'm trying to do, project the 2D vectors onto the triangle.

avatar image Julien-Lynge · Jul 02, 2013 at 04:26 PM 1
Share

You say two things that aren't compatible:

  • The Vector2s are on the plane of the triangle

  • You want to project the 2D vectors onto the triangle

Which is correct?

avatar image jfbguy · Jul 02, 2013 at 04:32 PM 0
Share

Perhaps this is confusion from semantics. The Vector2s are directions. Think of them as Vector3's with 0 as the z value. Their 'up', will be the normal of the Triangle plane. I want to use them, to find point V5.

avatar image Loius · Jul 02, 2013 at 04:43 PM 1
Share

Ins$$anonymous$$d of projecting the Vec2s onto the polygon, have you tried flattening the polygon onto the Vec2s?

Rotate the poly around V4 until its normal == Vector3.up. (or alternately until its Z values are the same, so you can use the Vector3s without translating them to Vector2s first). You'd have to translate V4 into a Vector3 first, then it'd be something like (V1 = (V1-V4)*rotation + V4).

Quaternion.FromToRotation might help; you can rotate a point with v3 * quat.

Edit: Oh yeah, get the rotation using FromToRotation - rotate from poly's normal to desired normal.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

18 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 avatar image avatar image avatar image avatar image

Related Questions

Most Optimal way of computing Delaunay Triangulation given an Array of Vector3 points 0 Answers

Failed setting triangles in my mesh 1 Answer

Rotating direction vectors 1 Answer

Need help with Vector3s and Vector2s 2 Answers

Mesh extrusion overlapping triangles problem 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