#Generating rotated meshes at runtime
26 messages · Page 1 of 1 (latest)
no
So, what are you using then to draw them?
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
Are you using ArrayMesh or something similar?
yes
Then you should be able to just "turn" these blocks while filling the vertices (or indices) array?
you mean for the world mesh or the individual mesh obj that i load in?
You said you are using an ArrayMesh? Then you are probably creating a surface_array as part of your terrain generation?
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
oh I see, you are using a library. What library is this?
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
That looks like a pretty huge library, not gonna lie. Unfortunately I don't have the time right now to dig deeper into this...
yeah it's ok
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.
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
Can you specify the texture atlas on a per-block basis?