Get vertices information of BaseParts, Unions and Meshes

This method would return a table of vector3 points representing the verticies of a 3D object.

Libraries like this would be really useful for people like me who work with model information and geometry.

It would allow us to create really neat visual effects and exporting libraries without costly ridiculous operations.

Roblox already seems to have internal APIs for this stuff (.obj export), so I don’t think adding this would be much of a task.

Proposed solution: (BasePart/Union/Mesh):GetVertices(bool relative = true)

The relative argument tells it whether or not the points should be relative to the actual location and rotation of the object or not.

40 Likes

local Mesh = Instance.new(“CustomMesh”)
Mesh.Vertices = {Vector3s}
Mesh.Triangles = {VerticeIndices}
Mesh.Texture = Texture
Mesh.TextureVertices = {VerticeIndices}

#SettingVertices please, but of course, this will never happen, although I do support getting vertices :slight_smile:

7 Likes

Going to bump this up in case an admin didn’t see it.
Sorry :stuck_out_tongue_winking_eye:

3 Likes

I know this is really old, but it’s still a feature i would like to see.

7 Likes

This is for sure something I’d like to see. If roblox added mesh deformation based on this then someone would be able to make a pretty good physics simulator in roblox. That would be awesome.

4 Likes

I know this is really old, but this is a feature I would like to see (alongside edges?). It would make it easier to do custom physics. For the edges it could return an adjacency matrix or list.

Parameters

locationRelative: bool

If true, the vertices will be relative to the world position of the part, if false, the vertices will be treated as if the part is at 0,0,0 (Defaults to true)

rotationRelative: bool

If true, the vertices will be relative to the rotation of the part, if false the vertices will be treated as if the part has no rotation (Defaults to true)

Returns

vertices: Array {Vector3}

An array of vertices of an object with positions of each vertex represented by a Vector3 Value

adjacencyList: Dictionary {number: {number}}

This shows how each point returned by vertices, relates to one another. For example it might be
{[1]={3,5,7}}, which means that vertex with array position 1 in vertices, is connected to the vertices with array positions 3, 5 and 7 in the vertices array.

Using vertexes in combination with sphere/box/part casting will allow much greater control over custom physics.

Perhaps normals of a vertices could be provided as well so faces could be determined, but I realise that may be too much.

14 Likes