• Getting the verticies from a brush
    8 replies, posted
I was wondering if it was possible to get the actual points of a brush entity in order to build a mesh from it. My end goal was to materialize an invisible brush so it would be visible, but I don't believe this is possible so another possibility would be to make a copy of the brush using a mesh. I know other people have done it, I just know know exactly how they did it and I can't find any useful information on the subject.
The only way to get the vertices of a brush is to parse the BSP data and extract the needed information. SilverLan made some stuff that did that under the title: 'Wrench'. It's on the workshop if you want to look at how he accomplished that.
[QUOTE=vexx21322;42149859]The only way to get the vertices of a brush is to parse the BSP data and extract the needed information. SilverLan made some stuff that did that under the title: 'Wrench'. It's on the workshop if you want to look at how he accomplished that.[/QUOTE] Sounds like it would just be simpler to do it once and store it in a .txt file in /data/ for further use rather than doing it in-game on runtime.
PhysObj:GetMeshConvexes() works on the world too, you dont have to parse the bsp yourself
[QUOTE=OzymandiasJ;42150109]Sounds like it would just be simpler to do it once and store it in a .txt file in /data/ for further use rather than doing it in-game on runtime.[/QUOTE] Once you've figured out how to do it there is no point in saving it to a file instead of generating it, so long as it is a quick process. Anyone know how long it takes?
[code] ] lua t = SysTime() this:GetPhysicsObject():GetMeshConvexes() print( SysTime() - t ) 0.042959296900563 [/code]
[QUOTE=Bletotum;42150912]Once you've figured out how to do it there is no point in saving it to a file instead of generating it, so long as it is a quick process. Anyone know how long it takes?[/QUOTE] That was on the assumption that I would have to decompile the BSP files and use a VMF parsing method, with a simple solution like posted above it should be pretty easy. It's just not something I've done before, they'res always something you don't know about a convoluted and poorly documented language :D (not Lua but the Gmod part)
[QUOTE=MDave;42150885]PhysObj:GetMeshConvexes() works on the world too, you dont have to parse the bsp yourself[/QUOTE] That returns the physics mesh, not the visual one [editline]11th September 2013[/editline] Nevermind I misread, thought OP wanted to do it on models (hard to read shit on my phone)
[QUOTE=EvacX;42151641]That returns the physics mesh, not the visual one[/QUOTE] Which is all I care about, so this is solved... Also brushes can have a visible mesh that isn't their physics mesh?
Sorry, you need to Log In to post a reply to this thread.