Posted: Tue Nov 02, 2021 4:16 pm Post subject:
VXL Scale, Tranform, Bounds
About .vxl files, can some expert here tell me the exact relationship between scale, transform and bounds? Any formula would also be really nice. QUICK_EDIT
Scale doesn't really do anything, it can be anything greater then 0 (RA2 voxels typically use 0.0833333358168602). If the voxel has multiple sections then all sections need to be the same though or it can cause problems.
The Transform matrix is used to control the voxel's position & rotation, its used in-conjunction with the HVA file to animate voxels.
Bounds are used to set the voxel's in-game render size & it's offset from the center point. _________________
It seems high scale values are crashing the game, but lower values (like 0.01) affect where the other sections such as rotors are positioned, so I don't think it does nothing.
So far I'm guessing it works like this:
Bounds are building a scaling/translation matrix, then multiplied with the transform. The final matrix is then used as a base for multiplication with each .hva frame, or maybe each hva frame replaces it dunno. Scale doesn't affect object size but is somehow applied to position other voxels/sections, probably as a precalculated value.
Again, if anyone knows more details about how this works kindly share it here, thanks! QUICK_EDIT
Yes the scale effects the Transform matrix calculations, so if you modify the matrix from the default settings & then later change the scale it will cause problems.
Most voxels dont use the Transform matrix & there is no reason to change the scale setting after you have initially created the voxel, so for the average person the scale is inconsequential.
There was an article written about 20 years ago explaining the file format in greater detail but I cant remember where it is now & who made it though. _________________
The most important thing to understand is that there is an _actual_ size as in the number of dots in any direction, and the _render_ size which is calculated by changing the bounds to be less than the actual size. I say less because if the bounds are larger than actual size, then the dots space themselves apart, and your voxel will become a point cloud instead of a solid.
When you should scale down something with bounds is not a straight answer, you have to draw the voxel with shrinkage in mind for best results, but you may not know if you want to shrink it before you make it either. The most common shrinkage I use is 80%, which means whatever the values you see in the bounds box after making (or resizing because it resets bounds) the voxel, you multiply them by 0.8 and replace the values. For the purposes of shrinkage, you are shrinking the canvas in its entirety, so don't worry about the resulting fractions, the game engine will figure it out.
Note VXLSE doesn't accurately center voxels unless they are an odd number wide and your object is slightly to the left (pretty sure left) so in any case, new or shrunken, HVA Builder will be necessary to properly re-center everything, using the voxel offset function. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
Thanks guys, but I'm not making voxels, I'm trying to make a 3D vxl/hva editor. It got pretty far already, load/save is bug free, rendering is almost done, same with the gizmos, viewport navigation etc but I need exact math to complete it.
The Scale field I believe is the theoretical dot size, it is nominally 1/12th because that seemed to correlate to 1 pixel on screen, and why there's no reason to change it.
The origin should be in the middle because all things in RA2/TS are based on either absolute center, except terrain objects that need an -15px offset. Ideally your ability to center the voxel automatically would be able to do fractional offsets (like 0.5px)...
The normals part is going to be the hardest tool to make, because there's no one right way, and often drawing a voxel will require 3-4 different sets of values for affecting the tool in VXLSE. Someone was working on another voxel editor and had tried to make a one-size fits all automatic normalizing, but from what I saw it only worked well on the smaller side of things, highlighting every edge of every step. Any normals tool would require lots of confguration choices open to user modification on the fly, the option of only normalizing newly drawn pixels, the ability to select pixels to clear of their normals value, etc. A normals smoother (and sharpener) brush would be nice to have, as would the ability to smooth along a plane only, so that any smoothing is done without influence from the perpendicular. I could go on about this for a while...
@G-E
It's not THAT difficult as you make it sound and I'm taking my time making it so it's not major effort for me, this is how I finish all my projects. Besides 3D is fun, just a vector play and much easier than 2D to be honest.
Making the final result show as expected ingame is the hardest part though that's why I need to know how the game engine transformations work to avoid things like rotors showing in the wrong places and such.
Manually adjusting to fix the current tools limitations is an unacceptable waste of time which can be better spent by doing actual modding... I'm also aiming for a friendly approach so artists won't have to do math or manual matrix setups...
The goal? Making the game I love better by supporting modders I guess, which usually returns a huge profit in play time QUICK_EDIT
Perhaps a better approach would be to use 3D to craft the model and then "render" it into a voxel? If you have the planes already defined by the surface shape, deriving normals from it is easy. In fact you could even keep the two editing modes in parallel to switch between, or at least preview the resulting voxel before you save. That approach hasn't been done before.
I mean I could suggest someone work on a voxel plugin for a modelling program like Blender or Max, in a sense bypassing the 3ds2vxl tool.
On the question of showing rotors in the wrong places, RA2 has a few conditions that determine voxel section dominance, a turret is always rendered over the hull for example. Under more normal circumstances the section that has its canvas closest to the viewer (even if it is just the corner of the canvas) is drawn over everything else, this is typically where rotor rendering fails, the rotor is made too small to encompass the corners of the main section. Sometimes it is unavoidable how a helicopter's tail is always going to be longer, and thus in approximately 1/3 of unit rotation will be closer to the viewer.
From my experience, it seems this dominance isn't a hierarchy, the game engine just picks 1 section to display over the others, the rest are occluded normally. I'm not sur ehow this helps you make the tool, it's more something the voxel creator has to understand. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
Besides manual editing, there will be a function to autocreate voxels from renders (real stuff like Blender/3DS/Houdini/whatever), the artist provides top, bottom, left, right, back and front renders (6 pictures) and the voxel model is built on the spot. Polish the final result if needed and auto/manual paint normals, then switch to hva mode to adjust things and that's it. QUICK_EDIT
This was a question I was about to ask until a saw this post.
How do I make the grizzly take bigger to match my other tanks in size ?
I did manage by mistake to make it very small so I reloaded the VXL and saw where it says SIZE IN GAME and I added 10 to each of the first numbers so like where X is 29.8234100341797, I just made it 39.8234100341797
I did get to the size I wanted but it came out all messed up.
So what are the proper function in hva builder to make it bigger ?
I did get to the size I wanted but it came out all messed up.
So what are the proper function in hva builder to make it bigger ?
Like I said, if you enlarge it past the number of actual dots they space themselves out. You need to add more actual dots.
You can use the "full resize" option which can double the voxel in every direction, but this results in a massive size, and blocky shape, which will then require you to go back and delete lots of unnecessary and unwated dots or even full layers.
A more useful approach is that you cut/copy and paste layers farther apart after just increasing the canvas size. You will have to expand your voxel in one direction, like say widen it, then expand it vertically or lengthwise, then the other. You still need to fix the resulting voxel, a round wheel won't look round with only a fractional increase in size, and it's likely any flat planes or vectored shapes like the tracks won't look right. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
The problem with that method is how would it handle hills and valleys in central parts only visible to 1 viewing angle though?
it's true that only works correctly for convex shapes, but should be much easier to fix details manually rather than doing it all from scratch by hand QUICK_EDIT
You could actually make voxels exceed their bounds/transform in TS without separating them like in RA2 (as shown in adam's screenie), something was changed in how voxels are drawn along the way _________________
ayylmao on Discord QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum