Help with render library.

Hello,

So i’m still working on my own fire entity. I managed to get it flaming other entities, damaging other entities. However i’m still trying to get it rendering as a textured box (a little bit like Minecraft’s fire).

Anyway, to achive this i tried the render.DrawBox which is working but textures are drawn without any possible rotations.

In second i tried render.DrawQuadEasy which is acting strangely with it’s arg normal (2nd one in gmod wiki) : textures are like a paper (We’re not in 2D !) !

At least i tried the render.DrawQuad directly which seams to be able to render in 3D (Yes !), but i can’t understand how GMod Vertex system is working. I tried the OpenGL 3D vertex system, but it’s not correct…

Fire textures in minecraft are like “paper”, and this is what you’ll need to do here too. You can either use drawsprite or drawquad (in case of the quad, you’ll need to force the quad to face player at all times with some maths.)

Ok i used Draw sprite and the problem is that it faces always me !!!

I don’t want the draw sprite to face me.

What DO you want then? Volumetric fire? You won’t get that in a game real time.

Hey, i got it ! So render.DrawQuadEasy is broken, Vector:Rotate doesn’t work with verticies.

And I just discovered how vertices works on GMod, it’s a little bit more easy then on OpenGL 3D.

If you wan’t to see what i wanted, just try this code :



	// FrontSide
	local vert1 = pos + Vector(-16, texW, texH)
	local vert2 = pos + Vector(-16, -texW, texH)
	local vert3 = pos + Vector(-16, -texW, -texH)
	local vert4 = pos + Vector(-16, texW, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)

	vert1 = pos + Vector(-16, -texW, texH)
	vert2 = pos + Vector(-16, texW, texH)
	vert3 = pos + Vector(-16, texW, -texH)
	vert4 = pos + Vector(-16, -texW, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)
	//End
	
	//BackSide
	vert1 = pos + Vector(16, texW, texH)
	vert2 = pos + Vector(16, -texW, texH)
	vert3 = pos + Vector(16, -texW, -texH)
	vert4 = pos + Vector(16, texW, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)

	vert1 = pos + Vector(16, -texW, texH)
	vert2 = pos + Vector(16, texW, texH)
	vert3 = pos + Vector(16, texW, -texH)
	vert4 = pos + Vector(16, -texW, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)
	//End
	
	//LeftSide
	vert1 = pos + Vector(-texW, 16, texH)
	vert2 = pos + Vector(texW, 16, texH)
	vert3 = pos + Vector(texW, 16, -texH)
	vert4 = pos + Vector(-texW, 16, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)

	vert1 = pos + Vector(texW, 16, texH)
	vert2 = pos + Vector(-texW, 16, texH)
	vert3 = pos + Vector(-texW, 16, -texH)
	vert4 = pos + Vector(texW, 16, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)
	//End
	
	//RightSide
	vert1 = pos + Vector(-texW, -16, texH)
	vert2 = pos + Vector(texW, -16, texH)
	vert3 = pos + Vector(texW, -16, -texH)
	vert4 = pos + Vector(-texW, -16, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)

	vert1 = pos + Vector(texW, -16, texH)
	vert2 = pos + Vector(-texW, -16, texH)
	vert3 = pos + Vector(-texW, -16, -texH)
	vert4 = pos + Vector(texW, -16, -texH)	
	render.DrawQuad(vert1, vert2, vert3, vert4)
	//End


Neither of that is true, you just don’t know how to use them properly.