Author Topic: CustomVoxels larger than 1x1x1  (Read 105 times)

adam_psst

  • Newbie
  • *
  • Posts: 33
    • View Profile
CustomVoxels larger than 1x1x1
« on: August 26, 2021, 05:26:14 PM »
Right now it is very difficult to generate custom voxel definitions for models which are not 1x1x1 in scale. There are various issues that arise when trying to generate custom voxels from 3D models which are not built to the 1x1x1 voxel scale:
1) Trying to actually generate the voxel definition so that it places the voxel in the right location is quite problematic. Often there is a lot of trial and error as to where the voxel will be placed when added into the scene, and this takes time. The issue here I believe is due to the checks on the custom voxel as to where the "center" of its bounds are.
2) When trying to highlight a custom voxel with its scale set to something smaller than 1x1x1, as it uses the bounds of the model itself this then generates a much larger highlight voxel than required. It would be really handy to have an option in the VoxelDefinition to specify how the highlight should be rendered, and even a custom setting which defines the actual scale the highlight should use plus how the center is calculated.
3) When trying to make voxels which are larger than 1x1x1, we run into similar issues where we cannot place them properly, their bounds are not visualised correctly, and trying to delete them is also problematic in some situations.

I feel there is a lack of documentation on generating voxels both smaller and larger than the default 1x1x1 in size, and it would be really beneficial to have something to support this. I can see there is documentation on generating a door, but that is quite custom. Explaining the scale setting on a voxel definition vs scaling the prefab that is passed in could also do with explaining a little more, as we are unclear which is the preferred approach.

Apologies if some of this has already been covered, but I could not find any topics on this so far.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: CustomVoxels larger than 1x1x1
« Reply #1 on: August 27, 2021, 09:13:36 AM »
The preferred approach is to have the prefab root tansform at default values (position = 0,0,0  scale = 1,1,1  rotation = 0,0,0) and control those values (offset and scale) through the voxel definition.
You can use custom transforms for the child objects of the prefab.

I'll review those issues with custom voxels - if you provide some custom voxel examples that will ensure the improvements fit them from day 0 :)

adam_psst

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: CustomVoxels larger than 1x1x1
« Reply #2 on: September 02, 2021, 11:25:14 AM »
I'll get my sample project updated for you with examples.