Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 ina · Jan 01, 2011 at 03:23 AM · meshlinerendererproceduralverticesnormals

Creating a mesh out of a linerenderer - how do you convert revolved vertices set to triangles and uv's

Suppose you draw a line using linerenderer (and also have an array of points) - how do you turn that into a mesh?

To elaborate on my question... As I understand, you will need triangles and uv's - not just vertices...

So, suppose you rotate about a circle each of the points on the 1-d line along its local y (or z axis), the one perpendicular to the plane of the line. How do you convert these to triangles and uv's?

The pictorial equivalent is a lathe - which starts out as a 1-d line in a plane, which you simply rotate about a circle in the perpendicular direction:

lathe

So, in sum:

  • I know how to generate the vertices.
  • I am not sure how to generate the triangles - are they simply, count the vertices from 0?
  • I am not sure how to generate the UV's - conformal mapping of the 3d mesh to a plane?--
Comment
Add comment · Show 6
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 Jessy · Jan 01, 2011 at 08:18 AM 0
Share

What is it that you need to do, which cannot be done with a Line Renderer, but is similar enough that you referenced it? You can certainly recreate what the Line Renderer does, but that would be pointless, unless it is limiting you somehow.

I don't understand your last paragraph; a diagram would probably help.

avatar image ina · Jan 02, 2011 at 03:45 AM 0
Share

updated w pic and summary

avatar image Jessy · Jan 02, 2011 at 05:20 AM 0
Share

Why are you using the terms "1D line"? That's a segmented curve, not a line, and it is clearly exists in two dimensions. I understand that you want to revolve a curve, not a shape that exists in a plane, but calling it 1D is poor wording. Additionally, you are never extruding vertices perpendicular to the plane that anything is in; that's the definition of a circle/lathe.

avatar image ina · Jan 02, 2011 at 05:23 AM 0
Share

sorry, it's a 1d curve from math (parametrically, at least - an object moving on the line only has one degree of freedom), but it might be called something else in other parlance

avatar image ina · Jan 02, 2011 at 05:29 AM 0
Share

no extrusion.. never mentioned extrusion... the rotation is along an axis perpendicular to the plane of the line

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jessy · Jan 01, 2011 at 08:16 AM

You cannot read data from a Line Renderer, so a direct conversion is impossible, without copying and pasting in the Editor.

Edit: Now that you've altered your question, check here. Using "LineRenderer" in the title is misleading; this has nothing to do with Line Renderers. A "lathe" is indeed what you should be asking about.

As for UVs, who knows what you want to do with that. Trying to texture something like this, in a non-abstract way, without actually using a modeling program, will be ridiculous.

Comment
Add comment · Show 4 · 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 ina · Jan 02, 2011 at 03:26 AM 0
Share

Well you would also have an array of points (convertible to vertices) - the line renderer simply renders the array of points.

avatar image Jessy · Jan 02, 2011 at 05:01 AM 0
Share

Who says? There's no requirement to keep the array around. If you were to just populate it in the Editor, you'd have no way of accessing that data, again, other than copy and paste for every Vector component. I don't understand the logic of exposing that array in the Editor, when you can't alter it programmatically, but that's how it is for the time being?

avatar image ina · Jan 02, 2011 at 05:31 AM 0
Share

Well, you don't have to expose that points array - it could be a private global var.. Anyway your S/O link is totally useless... As mentioned in the bullet points, I know how to generate the vertices (which are just points rotated in a circle), I'm just not sure how to turn a bunch of vertex points into a mesh.

avatar image Jessy · Jan 02, 2011 at 06:19 AM 0
Share

If you have all the vertices you need, then just connect them: http://unity3d.com/support/documentation/ScriptReference/$$anonymous$$esh-triangles.html

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

No one has followed this question yet.

Related Questions

Generate mesh from raycast positions, independent of rotations 0 Answers

How do I manually calculate Normals for my Meshes? 4 Answers

Do I need to split my mesh up to properly UV texture it? 1 Answer

Create Image on ground. 1 Answer

How do you scale a sphere or object by 2x using Mesh.vertices 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