Rendering texts on func_door_rotating entities

Hello all again,

Maybe you rember, i already got problems using cam.Start3D2D. Someone gave me ideas about math forulas for calculating offsets.
So, i succeeded to render correctly texts on every prop_door_rotating, and on some func_door entities.

But, i tried over 100 times to get texts rendering completely perfectly on func_door_rotating, but visibly the positions of these entities are not correct.

Basicaly, i have this code for rendering texts on func_door_rotating (code located in a PostDrawTranslucentRenderables hook) :



//entity represents the door witch is being rendered with texts on it.
//GameGlobal is a client side gamemode library witch contains many usefull methods, in this case the function returns a matrice containing every infos about a door.
		if entity:GetClass() == "func_door_rotating" then		
			local doorData = GameGlobal:GetDoorData(entity)		
			local name = doorData[0]
			local owner = doorData[1]
			
			local color = Color(255, 255, 0, 255)
			if (owner == LocalPlayer():SteamID()) then
				color = Color(0, 255, 0, 255)				
			elseif (owner == "none") then
				color = Color(255, 255, 0, 255)				
			elseif (owner == "NOT_OWNABLE") then
				color = Color(0, 0, 255, 255)				
			elseif (owner != LocalPlayer():SteamID()) then
				color = Color(255, 0, 0, 255)				
			end
		
			local angles = entity:GetAngles()
			local position = entity:GetPos()
			local offset = angles:Up() + angles:Forward() * -1.2 + angles:Right() * -4.5
			local offset2 = angles:Up() + angles:Forward() * 1.2 + angles:Right() * -1.5


			angles:RotateAroundAxis(angles:Forward(), 90)
			angles:RotateAroundAxis(angles:Right(), 90)
			angles:RotateAroundAxis(angles:Up(), 0)


			cam.Start3D2D(position + offset, angles, 0.1)
				draw.SimpleText(name, "DoorInfo", 50, -46, color, 1, 1)
				draw.SimpleText(name, "DoorInfo", 50, -46, color, 1, 1)
			cam.End3D2D();
			
			angles:RotateAroundAxis(angles:Forward(), 0)
			angles:RotateAroundAxis(angles:Right(), 180)
			angles:RotateAroundAxis(angles:Up(), 0)
			
			cam.Start3D2D(position + offset2, angles, 0.1)
				draw.SimpleText(name, "DoorInfo", -10, -46, color, 1, 1)
				draw.SimpleText(name, "DoorInfo", -10, -46, color, 1, 1)
			cam.End3D2D();
		end


In the hope i’ll get an answer,
Yuri6037

Nobody ?
Nobody has any idea ?

Seriously !?
So conclusion, DarkRP shouldn’t work then ? Because DarkRP are rendering texts correctly on func_door_rotating, so why nobody answers ?!

Jesus-fucking-christ, chill out…

What currently happens with that code? Does any text display? Is it in the wrong place?

If you know darkrp do it correctly, why you don’t look in darkrp code?

DarkRP doesn’t do what he’s looking for. I believe he wants to render a 3d2d set of text onto either side of the door and have it rotate with the door. DarkRP just pops text onto the hud. But OP needs to clarify what the issue is if he wants help.

Ok, so it’s simple : texts are simply not in the correct position that’s all… I can see them, but they’re always in wrong position.

Take some screenshots?

Ok, here is some screenshots uploaded by steam :
Examples of the city center of rp_evocity_v33x :

Examples of big homes (still in evocity v33x) :

Oh… Well the angles are off then and probably the positions. I’m not good with the math involved with that though.

I’m thinking of something simple. So I found that the position of these entities aren’t correct. But the colision boxes are all correct. So maybe it’s possible to get the poison of the colision box instead of the position of the entity ?


ent:OBBCenter()
ent:OBBMaxs()
ent:OBBMins()

Can help you with this.