2D Grid on 3D Mesh

Blitz3D Forums/Blitz3D Programming/2D Grid on 3D Mesh

SilverDragon(Posted 2016) [#1]
Hi there, I've been researching all day on how to do this and couldn't quite find (or think of) anything. My aim is to have some form of 2D grid (whether square, hexagonal, etc.) onto my custom 3D map mesh, with the shapes "conforming" to the mesh -- in other words, its not a straight plane laid over a map, but the grid is on the surface of the map.

I found code for showing the wireframe of an mesh with it staying solid, I tried that but it wasn't what I was looking for. I'm assuming now it might have to do with brush or surface commands (which are a few things I have hardly worked with). Does anyone have any ideas or know the best route to go?

For a better frame of reference, think of the Fire Emblem: Radiant Dawn maps.



Thanks, Austin

(This is my first post, although I've been using Blitz for a long time, so please correct me if I'm doing something wrong.)


Matty(Posted 2016) [#2]
Have a texture with a grid pattern(white cells, black lines) on it. Apply it multiply blended. Potentially adjust the UV coords or use a secondary UV set for this. Think of it like a detail texture on a terrain.


RemiD(Posted 2016) [#3]
There is a directx function to draw 2dlines between the vertices of a surface.
See : http://www.blitzbasic.com/Community/posts.php?topic=100959 (#13 and #15)


Kryzon(Posted 2016) [#4]
Hi Austin. You should probably go through some fundamental 3D concepts, like what is a 3D mesh made of, and how to apply textures to that mesh (what are UV coordinates etc.). The challenge is finding decent material for learning, but at least once you learn it you can apply it in any 3D engine since they use the same conventions.
https://blog.nobel-joergensen.com/2010/12/25/procedural-generated-mesh-in-unity/
https://blog.nobel-joergensen.com/2011/04/05/procedural-generated-mesh-in-unity-part-2-with-uv-mapping/

http://iadbungler.free.fr/bcoder/cgi-bin/articles/Wc2e06f9b3ff9.htm (taken from here)
http://jnoodle.com/Blitz3D/
http://jnoodle.com/Blitz3D_1/

That 3D ground doesn't seem to use anything more complex than what a plain mesh and texturing can do.
Nack did something similar with Blitz3D, but again it's just a 3D mesh and textures:
- http://www.blitzbasic.com/Community/posts.php?topic=100614
- http://www.blitzbasic.com/Community/posts.php?topic=98247


RemiD(Posted 2016) [#5]
I agree with Kryzon, you can probably achieve the same render by using different tilemeshes with different textures. Or maybe the same texture but sometimes you apply a fx of normal vertexlighting and sometimes a fx of fullbright (when the tile is highlighted)