I have read through this document, but it makes zero sense. Some of the stuff in there doesn’t cover with what they do.
I’ve seen past explanation on this topic, but because editable mesh has be changed the old topics are out of date.
-- //Services
local AssetService = game:GetService("AssetService")
-- //
local meshPart = script.Parent
local editableMesh = AssetService:CreateEditableMeshAsync(meshPart.MeshContent)
local editableMeshAsync = AssetService:CreateMeshPartAsync(Content.fromObject(editableMesh))
-- //
for _, vertexId in editableMesh:GetVertices() do
local pos = editableMesh:GetPosition(vertexId)
editableMesh:SetPosition(
vertexId,
pos + Vector3.new(0, 1, 0)
)
end
-- //
meshPart:ApplyMesh(editableMeshAsync)
the methods and functions explained in roblox documentation editable mesh there makes absolutely no sense, maybe suggest us a community tutorial or guide?
--!strict
local AssetService = game:GetService("AssetService")
local RunService = game:GetService("RunService")
local meshPart = workspace:WaitForChild("twisted_torus"):WaitForChild("default")
local editableMesh = AssetService:CreateEditableMeshAsync(meshPart.MeshContent)
local success, newMeshPart = pcall(AssetService.CreateMeshPartAsync, AssetService, Content.fromObject(editableMesh), nil)
assert(newMeshPart)
meshPart:ApplyMesh(newMeshPart)
local r = Random.new()
local vertexPosition: { [any]: Vector3 } = {}
local vertices = editableMesh:GetVertices()
for _, vertexId in vertices do
vertexPosition[vertexId] = editableMesh:GetPosition(vertexId)
end
RunService.Heartbeat:Connect(function()
for vertexId, originalPosition in vertexPosition do
editableMesh:SetPosition(
vertexId,
originalPosition + r:NextUnitVector()
)
end
end)
so basically what you need to do is ApplyMeshbefore changing EditableMesh instance
thanks, this does help - i didnt know you needed it to be in a local script. I thought it was a server one.
im focusing on a cloud noise for a sphere like this, is there a certain type of geometry i need to aim for to aquire this?
like a a high poly sphere, medium or low (not too low of course), as well as the edges for a better topology
i can do the coding, just found the document for editable mesh all over the place
its in unity but, i thought if i could use editable image and editable meshs to simulate a cloud and also leverage a image for cloud “shadow” depth detail that wraps around on the edges, like cloud density but darker
Its hard to go by because the noise is random but the fequency and bump of it doesnt look doable for a standard high poly mesh of a sphere?
it should be a procedural 3d noise, that is, when it starts at any position with the same seed it produces same values for the same offset from the position, so you get same offset for vertex displacement or color for texture at any point in space.
yeah, you might need to increase mesh density in bumped areas to avoid sharp edges and generate even noise at the areas.