#Generating rotated meshes at runtime

26 messages · Page 1 of 1 (latest)

primal snow
#

Are your voxels individual MeshInstances?

full light
#

no

primal snow
#

So, what are you using then to draw them?

full light
#

there is a mesh instance that has all the blocks, it is dynamically generated and as of now it does not support changing a single part of the mesh to rotate it

#

so the only solution is to pregenerate meshes that it can append to itself with all the possible rotations

#

that's why I need to generate them at run time... well i don't exactly need to since I can rotate them manually in blender or something

primal snow
#

Are you using ArrayMesh or something similar?

full light
#

yes

primal snow
#

Then you should be able to just "turn" these blocks while filling the vertices (or indices) array?

full light
#

you mean for the world mesh or the individual mesh obj that i load in?

primal snow
#

You said you are using an ArrayMesh? Then you are probably creating a surface_array as part of your terrain generation?

full light
#

I would suppose so, the world generation is part of a library and it's not something I can modify, that's why as of now the only solution would be to define each rotation of the mesh as a seprate voxel type for the world loader to generate

primal snow
#

oh I see, you are using a library. What library is this?

full light
#

I asked the author if it were posible to rotate a mesh in the world without creating separate voxel types and he said not yet thats why I am trying to (as a bandaid fix for now) generate all possible rotations

primal snow
#

That looks like a pretty huge library, not gonna lie. Unfortunately I don't have the time right now to dig deeper into this...

full light
#

yeah it's ok

primal snow
#

Without actually taking a look at the docs: it might be doable by just pregenerating multiple versions of your texture. Turning the texture would basically look the same as if the geometry itself was turned.

full light
#

that's a bit of a problem since the texture I use for all the blocks is an atlas generated at runtime

#

and I just have uv offsets specified for a block

#

if I change the uvs for the block it will change them for all block instances in the world

#

i did manage to find an easier solution but its still a band aid solution and will need changes when the lib starts supporting rotational data

#

I will close this post

primal snow
full light
#

I don't exactly get what you mean

#

oh whait are you asking if I can provide diffrent atlases to diffrent blocks?