Hi all,
I'd been many years away from ZGE, bear with me with questions...
Now i'm teaching my son to program games and we are working on a kinda of "Minecraft clone" (I know, nobody tried it ).
Everything is working great, we are creating a bitmap for each texture, but its a way to map a cube using a texture of a texture sheet, like having a big bitmap with all textures and using it like we used to using a tile or a sprite IRC?
Sorry if the question is too stupid.
Kind regards,
Luis.
PS. Nice to come back and I can't believe the ZX exporter... I was using Jonathan Cauldwell's MPAGD... but I think I would love ZGE zx generator...
I need to try it...
Mapping a Cube from a texture sheet
Moderator: Moderators
Mapping a Cube from a texture sheet
Close, but not there yet.
Re: Mapping a Cube from a texture sheet
Hi Luis,
There's a couple of ways to do this, but generally you want to calculate ( or look-up ) the appropriate texture coordinates for each cube "type". See attached file for a basic example.
The thing is though .. since Minecraft uses so many cubes it isn't really viable ( performance-wise ) to render each cube as a individual mesh / model. So if you're aiming for a similar number of cubes as Minecraft you're going to have to use OpenGL calls to speed things up.
K
There's a couple of ways to do this, but generally you want to calculate ( or look-up ) the appropriate texture coordinates for each cube "type". See attached file for a basic example.
The thing is though .. since Minecraft uses so many cubes it isn't really viable ( performance-wise ) to render each cube as a individual mesh / model. So if you're aiming for a similar number of cubes as Minecraft you're going to have to use OpenGL calls to speed things up.
K
- Attachments
-
- Block.zgeproj
- (101.87 KiB) Downloaded 363 times
Re: Mapping a Cube from a texture sheet
Welcome back Luis
Re: Mapping a Cube from a texture sheet
Thanks KJell for the example.Kjell wrote: ↑Mon Jul 27, 2020 9:45 am Hi Luis,
There's a couple of ways to do this, but generally you want to calculate ( or look-up ) the appropriate texture coordinates for each cube "type". See attached file for a basic example.
The thing is though .. since Minecraft uses so many cubes it isn't really viable ( performance-wise ) to render each cube as a individual mesh / model. So if you're aiming for a similar number of cubes as Minecraft you're going to have to use OpenGL calls to speed things up.
K
I understand the perf issue, Its more a proof of concepts of sorts, so I don't think we're gonna hit that.
Its difficult to work with the little attention span of this generation (I feel really old)
Another questions:
1. Is it possible to generate a bitmap from a region of another bitmap (like Bitmap Load)?
2. Is it possible to render a font into a mesh, can I rendertext to another surface and use it?
Kind regards,
Luis.
Close, but not there yet.