i found a bug:
when using the renderclipplane, while clipped and undoing / removing the prop the game shuts down.
[QUOTE=Callee]i found a bug:
when using the renderclipplane, while clipped and undoing / removing the prop the game shuts down.[/QUOTE]
Remove the clip plane before removing the prop.
[QUOTE=Xera]Remove the clip plane before removing the prop.[/QUOTE]
how do i do that?
Is there a gamemode hook or something?
[QUOTE=Callee]how do i do that?
Is there a gamemode hook or something?[/QUOTE]
[url]http://wiki.garrysmod.com/wiki/?title=Gamemode.EntityRemoved[/url]
[QUOTE=Deco Da Man]...Jinto made all the extra tools and did a shot load of math for this new Portal gun...[/QUOTE]
The math isn't that hard.
[b]Edit:[/b]
I wrote this for the stargates but it will work for portals.
[lua]function StargateExtras:GetTeleportedVector(ent1, ent2, pos, aim)
local pos1 = ent1:LocalToWorld(ent1:OBBCenter())
local pos2 = ent2:LocalToWorld(ent1:OBBCenter())
local dir1 = pos-pos1
local ang1 = ent1:GetAngles()
local ang2 = ent2:GetAngles()
local rpos = pos2+(dir1:Angle()-ang1+ang2):Forward()*(dir1:Length())
local v = ((-1*aim):Angle()-ang1+ang2):Forward()
local rdir = 2*(ang2:Forward():DotProduct(v))*(ang2:Forward())-v
return rpos, rdir
end[/lua]ent1 is the portal you enter
ent2 is the portal you exit
pos is the position of the ply/prop/whatever getting teleported
aim is the direction in which it is going
and best of all [b]No Gimbal Lock[/b] i suppose could add angle translation for objects as well.
THIS MODULE IS PART OF A CONSPIRACY!
JINTO IS TAKING OVER THE WORLD:
[img]http://i64.photobucket.com/albums/h186/xian-o/whenkillerbunniestakeovertheworldbq.gif[/img]
[I]No use resisting, the game we played is now at an end...[/I]
[QUOTE=HPD user]perhaps Luabanana should make his own thread seeing as how that one is half dead[/QUOTE]
yep it just died.(was closed)
[i]You'll only know it's the end when the black hole appears. Then, well, Lay down and die.[/i]
[i]They're coming... And they have A plan.[/i]
[i]I'm Firin' Mah Lazor![/i]
[i]All of your bases are belonging to us![/i]
All of these, and more will occur to you unless you create a working portal gun in GMod and distribute it to us.
Problem, it'll never happen: Mahalis already made a working one.
Ontopic: Can someone give an example of what the difference is between the image formats and how to use the fogger subsystem? I can't seem to have any luck with it. :(
[QUOTE=OlivierHamel]Problem, it'll never happen: Mahalis already made a working one.
Ontopic: Can someone give an example of what the difference is between the image formats and how to use the fogger subsystem? I can't seem to have any luck with it. :([/QUOTE]
These must be some DirectX things. You should look in the MSDN for that and do some googleing. But mostly you can use the different image formats to generate textures with different bit depths and channels. For example IMAGE_FORMAT_RGBA16161616F is mostly being used as a render target for the HDR screenbuffer (like in the Source engine) as it has a 16bit depth per color channel and uses floating point precision so the values in the textures per pixel and color channel are between 0.0 and 1.0. All the other image formats can be used to accomplish different things in different situations.
Now to my stuff: I posted already yesterday that I have a problem with writing to the alpha channel to a texture. The standard render modul does not have such a functionality and this library does not seem to feature this. Maybe Jinto you can make such a thing for us as it can be used to create awesome graphic effects (I plan to create a new postprocessing effect).
I just tried the whole library for the first time and couldn't achieve anything.
I tried a simple entity with this draw function.
[lua]function ENT:Draw()
local plane = Plane( self:GetRight(), self:GetPos() )
render.EnableClipping(true)
render.PushCustomClipPlane( plane )
self:DrawModel()
render.PopCustomClipPlane()
end[/lua]
But it doesn't get rendered at all, no errors or anything like that.
[QUOTE=BlackNecro]I just tried the whole library for the first time and couldn't achieve anything.
I tried a simple entity with this draw function.
[lua]function ENT:Draw()
local plane = Plane( self:GetRight(), self:GetPos() )
render.EnableClipping(true)
render.PushCustomClipPlane( plane )
self:DrawModel()
render.PopCustomClipPlane()
end[/lua]
But it doesn't get rendered at all, no errors or anything like that.[/QUOTE]
The Plane() function returns a table with normal and distance. You need to pass both those to PushCustomClipPlane(). The vplane I mention in the first post is from my mathlib which I will be releasing sometime soon. You'll need to make sure clipping is enabled with a call to render.EnableClipping( true ).
Ok, i kind of get what it does, just how do i use it? I have downloaded both types of files on the first page, just what do i do with them, they are just full of files...
[QUOTE=Jinto]The Plane() function returns a table with normal and distance. You need to pass both those to PushCustomClipPlane(). The vplane I mention in the first post is from my mathlib which I will be releasing sometime soon. You'll need to make sure clipping is enabled with a call to render.EnableClipping( true ).[/QUOTE]
Ah cool t hanks and about enabling clipping ... line 5 doesn't do the job? :v:
EDIT:
[lua]function ENT:Draw()
local plane = Plane( self:GetRight(), self:GetPos() )
render.EnableClipping(true)
render.PushCustomClipPlane( plane.normal, plane.distance )
self:DrawModel()
render.PopCustomClipPlane()
end[/lua] Still nothing drawn
[QUOTE=KrAzY_nikomo]GTalk I think.[/QUOTE]
Awesome, Garry's Talk.
[QUOTE=BlackNecro]Ah cool t hanks and about enabling clipping ... line 5 doesn't do the job? :v:
EDIT:
[lua]function ENT:Draw()
local plane = Plane( self:GetRight(), self:GetPos() )
render.EnableClipping(true)
render.PushCustomClipPlane( plane.normal, plane.distance )
self:DrawModel()
render.PopCustomClipPlane()
end[/lua] Still nothing drawn[/QUOTE]
You probably also want to disable clipping :v:
[QUOTE=BlackNecro]Ah cool t hanks and about enabling clipping ... line 5 doesn't do the job? :v:
EDIT:
[lua]function ENT:Draw()
local plane = Plane( self:GetRight(), self:GetPos() )
render.EnableClipping(true)
render.PushCustomClipPlane( plane.normal, plane.distance )
self:DrawModel()
render.PopCustomClipPlane()
end[/lua] Still nothing drawn[/QUOTE]
Did you try using PrintTable on plane? The normal and distance aren't lowercase.
[QUOTE=Jinto]Did you try using PrintTable on plane? The normal and distance aren't lowercase.[/QUOTE]
*cripples down to a heap of ashamed something*
[QUOTE=PHi11Y]Awesome, Garry's Talk.[/QUOTE]
Google Talk.
[QUOTE=Mr Affinity]Google Talk.[/QUOTE]
Nah, google is actually owned by garry, he is also gman.
I've installed the .dll into Lua/Includes/Modules
and I tried that example code from the first post
(I replaced in the material of course), But it just
spams "ClearStencil(): Nil Value" on the side of my
screen. Did I install the .dll wrong?
[QUOTE=zalo]I've installed the .dll into Lua/Includes/Modules
and I tried that example code from the first post
(I replaced in the material of course), But it just
spams "ClearStencil(): Nil Value" on the side of my
screen. Did I install the .dll wrong?[/QUOTE]
Did you forget to require it?
[lua]require( "renderx" );[/lua]
Whoops! Indeed I did. And it worked kinda. With some very interesting results.
Groovy Results. Tons more entertaining than what I actually intended it to do.
The entire screen's drawing goes crazy.
The water disappears, the insides of models
draw on top of the outside, everything looks wicky-wacky.
Apparently it thinks I'm trying to preform arithmetic on the file directory
Or it expects IMaterial and gets string or something.
As you can see, I know about as much Lua as my "Smartness" depicts.
Since I'm probably not going to release anything with this (since it probably wouldn't be very good) you don't need to tell me what I'm obviously doing wrong.
I'll just enjoy this in the mods that are released off it.
And have a nice *whatever time of day you are*. Thanks for the help.
Sounds like a renderer screw over, check your render.StartBeams/EndBeams and look out for errors in cam.Start<x>/cam.End<x>.
[QUOTE=zalo]Whoops! Indeed I did. And it worked kinda. With some very interesting results.
Groovy Results. Tons more entertaining than what I actually intended it to do.
The entire screen's drawing goes crazy.
The water disappears, the insides of models
draw on top of the outside, everything looks wicky-wacky.
Apparently it thinks I'm trying to preform arithmetic on the file directory
Or it expects IMaterial and gets string or something.
As you can see, I know about as much Lua as my "Smartness" depicts.
Since I'm probably not going to release anything with this (since it probably wouldn't be very good) you don't need to tell me what I'm obviously doing wrong.
I'll just enjoy this in the mods that are released off it.
And have a nice *whatever time of day you are*. Thanks for the help.[/QUOTE]
The fix for the whacko shit would be render.DisableStencil( ) if you are using stencils.
A release of that Homeworld Hyperdrive would be :krad:
or is it one of those Coder keepsakes for epic shit?
[QUOTE=MattyK]A release of that Homeworld Hyperdrive would be :krad:
or is it one of those Coder keepsakes for epic shit?[/QUOTE]
I was going to make this actually but then i saw LuaPinnaple was allready working on it so :/
[b]Edit:[/b]
Jinto i don't suppose we could see some cool functions along the lines of Ent:SetModelWorldScale() and Ent:SetModelScale(). But better such as defining a vector axis to warp the model along or something.
Not working on it anymore, lost interest, and when I lose interest I produce shitty stuff.
lol true true
Sorry, you need to Log In to post a reply to this thread.