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 /
  • Help Room /
avatar image
1
Question by codeguyross1 · Sep 08, 2016 at 03:00 AM · meshsizevertices

How do I change the size of vertices in a mesh?

I would like to change the size of the vertices in a mesh that is being procedurally generated but I am unsure how to do so

Here is the mesh generation code:

 using UnityEngine;
 using System.Collections;
 
 
 [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
 public class PointCloudTestMesh : MonoBehaviour {
     
     private Mesh mesh;
     int numPoints = 100;
     // Use this for initialization
     void Start () {
         mesh = new Mesh();
         
         GetComponent<MeshFilter>().mesh = mesh;
         CreateMesh();
     }
     
     void CreateMesh() {
         Vector3[] points = new Vector3[numPoints];
         int[] indecies = new int[numPoints];
         Color[] colors = new Color[numPoints];
         for(int i=0;i<points.Length;++i) {
             points[i] = new Vector3(Random.Range(-10,10), Random.Range (-10,10), Random.Range (-10,10));
             indecies[i] = i;
             colors[i] = new Color(Random.Range(0.0f,1.0f),Random.Range (0.0f,1.0f),Random.Range(0.0f,1.0f),1.0f);
         }
         
         mesh.vertices = points;
         mesh.colors = colors;
         mesh.SetIndices(indecies, MeshTopology.Points,0);
         
     }
 }


What do I need to do to get these vertices to be a different size?

Comment
Add comment · Show 2
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 doublemax · Sep 08, 2016 at 07:16 AM 0
Share

What exactly do you mean with size? Vertices are mathematical points, they don't have a size.

If you want visible "points", ins$$anonymous$$d of cresting a new mesh, you could create a new, empty gameobject and add small spheres as children of that object.

https://docs.unity3d.com/ScriptReference/GameObject.CreatePrimitive.html

avatar image codeguyross1 · Sep 08, 2016 at 02:31 PM 0
Share

I was hoping that there was some kind of shader or method I could use to make the points bigger than 1 pixel. $$anonymous$$aybe a method that would create a group of points that represent a single point which is what I will probably end up doing unless there is a better way. The goal is to be able to display up to several million points at a time. I could do this with gameobjects but I think that unity cannot handle millions of gameobjects at a time. However, I could be wrong on Unity's ability to handle millions of gameobjects as I haven't tested it yet.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by timetosmile · Oct 05, 2017 at 10:28 AM

I also looking for the same answer. I cannot believe that it is no more possible to change the size of a vertex.

I found a view description how to solve this problem, but there only work with openGl oder DX9 but this also doesn't work for me.

I tried it with glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); an -force-opengl --> no changes. I changed the graphics API of Unity to all different possibilites but still no changes.

I am desperated an have no clue why nothing is changed. I used this http://www.kamend.com/2014/05/rendering-a-point-cloud-inside-unity/#comments for ma problem but it only allows to show colored small points. But I need to fill the emptyroom between them.

An other hint is to bild for each vertx a quad, but I think this would be to much for 90M Points. And a simple outside mesh is also not wanted cause I want to see in the model and compare changes in it.

Hopefully someone has a good idea or hint for me.

Thank you

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

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

Related Questions

Vertex coordinates of mesh imported from Blender as fbx are all equal to 0,0,0? 0 Answers

Adding Vertices to Coded Mesh? 0 Answers

Colliders position and scaling are misaligned with object meshes 0 Answers

How to dynamically scale an object to a fixed, predefined size at runtime? 0 Answers

Meshes in build occupy too much space 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