I have a very simple voxel engine and so far it works based on coordinates, e.g. x, y, z. I was wondering if there is a formula for rotating groups of voxels/coordinates from the x axis(e.g. [0, 1, 0][1, 0, 1] rotates to [1, 0, 0][0, 0, 1] when rotated 90 degrees anticlockwise along the x axis) from a certain point, but I hear it involves matrixes and quaternions which sound scary.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
1) The non-scary way to do 90-degree rotations is to swap a set of axes, and negate one of them:
|
|||||||||
|
|
You can't get too far into any 3D programming without matrices or quaternions. It's not too scary though. There are plenty of resources available to you, since you can use some existing resources 3D model transformations. Just think of all your voxel positions as vertex positions. With that in mind, you can apply a transformation matrix to the voxel positions. However, I imagine you'd want your voxel positions to still align to a grid afterwards, so you'd need to pick your transformations carefully. |
|||
|
|
