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 Rez · Jul 19, 2010 at 05:48 AM · textgraphicsobjectscsvphysical

How to create an object from 3D points in a text file?!

Hi,

I was wondering if it is possible to create a physical object in Unity using a set of 3D points whose values have been stored in a simple text file (or say, a CSV). In other words I want to be able to create an object with many points above the "ground" level and the location of those points (vertexes) are included in a text file (X,Y,Z). Is there a way to do such primitive drawings?! I had a brief look at GL option but cannot even draw a simple line! Could someone please provide an example (script)?! Also, I would like to be able to change the file outside Unity (change the points' locations) and have the changes reflected in Unity!

Thank you in advance for your attention and kind replies.

Regards,

M.H.

Comment
Add comment
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

2 Replies

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

Answer by Eric5h5 · Jul 19, 2010 at 07:28 AM

Sure, use the Mesh class. Use System.IO for reading files. Look at the procedural examples for illustrations of how the Mesh class is used. (GL is for immediate mode, but GL.LINES draws lines without any particular difficulty, as long as you have Unity Pro.)

Comment
Add comment · Show 1 · 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 Rez · Jul 19, 2010 at 09:07 AM 0
Share

Hi Eric5h5,

Thank you for your useful comments. The System.IO does not have any useful methods(commands) for parsing CSV files, Does it? Also, if I were to draw some arbitary lines how can the space between be filled to create a full 3D object? Does the meshing do that?!

B.T.W., how come I can't do this in Unity:

// while ( (tcxt = fReader.ReadLine()) != null ){

I had to do this which obviously not ideal at all! //tcxt = fReader.ReadLine(); //while ( tcxt != null ){

Does it not support assigning and condition checking in one line!! Java and Java Script do?! Thanks.

avatar image
0

Answer by Julian-Glenn · Jul 19, 2010 at 12:08 PM

Almost a duplicate question to this:

http://answers.unity3d.com/questions/15750/how-to-create-a-3d-object-terrain-using-imported-data-csv-txt/15751#15751

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

No one has followed this question yet.

Related Questions

How to access value within instantiated class in different object? 1 Answer

Changing Pixel Colors for Passing Objects 1 Answer

icon or text activates script 0 Answers

Low level text writing 1 Answer

parsing csv file 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