-
Notifications
You must be signed in to change notification settings - Fork 13
RenderManager
MINIONBOTS edited this page May 3, 2014
·
7 revisions
- The RenderManager allows you to draw and render whatever you want, wherever you want. You can build everything you want to be drawn by adding single 3d points (vertices) together to a form/object you want. The included MarkerManager for example, is using these functions to draw the markers.
- RenderManager:AddObject(t)
- t beeing a table of multiple 3d points, returns an index to keep track of the object created.
- RenderManager:RemoveObject(id)
- Removes the object from the list to be drawn by its ID.
- RenderManager:RemoveAllObjects()
- Clear the whole draw list, please be aware that this also clears everything else that should get drawn by other modules.
local pos = marker:GetPosition()
local color = 1 -- red
local s = 1 -- size
local h = 5 -- height
local t = {
[1] = { pos.x-s, pos.y+s+h, pos.z-s, color },
[2] = { pos.x+s, pos.y+s+h, pos.z-s, color },
[3] = { pos.x, pos.y-s+h, pos.z, color },
[4] = { pos.x+s, pos.y+s+h, pos.z-s, color },
[5] = { pos.x+s, pos.y+s+h, pos.z+s, color },
[6] = { pos.x, pos.y-s+h, pos.z, color },
[7] = { pos.x+s, pos.y+s+h, pos.z+s, color },
[8] = { pos.x-s, pos.y+s+h, pos.z+s, color },
[9] = { pos.x, pos.y-s+h, pos.z, color },
[10] = { pos.x-s, pos.y+s+h, pos.z+s, color },
[11] = { pos.x-s, pos.y+s+h, pos.z-s, color },
[12] = { pos.x, pos.y-s+h, pos.z, color },
}
local id = RenderManager:AddObject(t)