Jump to content

Recommended Posts

Posted

In an effort to figure out if i can bring my external interactive map into the game ive been looking at ways to draw debug shapes, like eg lines, into the world simply to have a visual indicator for if my transforms are applied correctly.

Looking at pictures like below i see its possible. Altough im just starting to mod this game and have been unable to find an api todo this in the game.

Debug-wireframe-entity-polarbear.png.9fb0e52a40675caa12ccb1c04ba0f990.png

❤️

  • Solution
Posted

You certainly can do this. 

First, you'll want to create some lines. You can use the LineMeshUtil class to generate a 3D mesh for your lines.

You can position and/or rotate the mesh if desired, but you need to upload it to the graphics card using 'capi.Render.UploadMesh(...)'.

Then, you can render the mesh using the render API. You will want to use the 'EnumShaderProgram.Wireframe' shader, and you'll likely want to use one of the predefined render functions, e.g. 'OnRenderFrame'.

For an actual example, see https://github.com/anegostudios/vsapi/blob/a2e2ca074c351d9154101107c704fd4d63161d51/Client/Render/WireframeCube.cs#L9.

Hope this helps!

  • Like 1
Posted
6 hours ago, Nat_VS said:

You certainly can do this. 

First, you'll want to create some lines. You can use the LineMeshUtil class to generate a 3D mesh for your lines.

You can position and/or rotate the mesh if desired, but you need to upload it to the graphics card using 'capi.Render.UploadMesh(...)'.

Then, you can render the mesh using the render API. You will want to use the 'EnumShaderProgram.Wireframe' shader, and you'll likely want to use one of the predefined render functions, e.g. 'OnRenderFrame'.

For an actual example, see https://github.com/anegostudios/vsapi/blob/a2e2ca074c351d9154101107c704fd4d63161d51/Client/Render/WireframeCube.cs#L9.

Hope this helps!

Yes that suffices! Thank you very much!

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.