Post
by Feralidragon » Wed Nov 27, 2019 2:19 am
There's a way to draw something close to that kind of cylinder in-game, without resorting to drawing 1 pixel at a time (which is super heavy on the CPU, since it's not what a CPU is meant to do), or going native, or anything else, and it will work everywhere.
Just create a cylinder mesh, and give it a simple texture so that the edges are rendered as something close to a wireframe.
You can even get creative and not limit it to a wireframe view, and have some gradients instead, or procedural textures, whichever you like.
Then all you have to do is to render it in the canvas in the same position as any other actor.
From there, since what you want is for the cylinder to reflect what essentially is a given radius and height, which may and will vary independently from one another, and since Drawscale alone doesn't cut it, since you cannot affect different axis differently (to stretch the cylinder), there's a second step to the cylinder mesh creation: make it so that the cylinder is animated, with the first frame where the cylinder bases (circles) are collapsed onto one another, like a thin pancake or a circular sheet, and the second frame with them set apart to a specific value.
By doing the above, in UScript you can then affect the mesh height with AnimFrame (where 0.0 is height=0 and 0.5 is max height) and the radius with Drawscale, although the calculation of AnimFrame will need to take the Drawscale into account (so you calculate the Drawscale directly from the radius, then you calculate AnimFrame using the given height and considering the previously calculated Drawscale).
If you import it as a vertex mesh, you're limited to the bounding box of the mesh itself, meaning that the max height would be 256uu at most, but this limitation is only applied to the source mesh file (*_d.3d), and in the import directives you may set whichever scale you want in whichever axis you want, independently, and so here you can set the Z axis to 2000x or so (a ludicrously high value) to ensure that the max height is enough to always work within the maximum map area (the max distance from any one point to another within the mapping area is about 113.511uu, so by setting the Z scale to 1000x for a 256uu mesh, you get a mesh 128.000uu long [not 256.000uu since the Z axis needs to be doubled, due to one less bit used in the Z-axis], which is enough to cover all possible heights to render).
Using the same exact principle, you can create 3D lines instead, and then render them together however you want.
This is essentially how in my gore mode, things like guts and such, are able to stretch and compress and look more "gooey", they're just cylinders using a mix of Drawscale and AnimFrame to scale the mesh in 2 different sets of axis independently.