Isometric images of nodes

Post Reply
Jolesh
New member
Posts: 8
Joined: Tue Sep 20, 2022 19:54
GitHub: jolesh

Isometric images of nodes

by Jolesh » Post

Hej,
I am creating wikis for my mods and want to add pictures for my nodes. I don't want the normal side or top view aka. the texture files, but instead I want to add images like the ones in the inventory (isometric). Is there a (simple) way to get those? I guess the ones in the inventory are rendered and not saved anywhere.

So basically I want to do more or less the same thing as the minetest wiki and add images like this:
Image
https://wiki.minetest.net/File:Dirt_with_Grass.png

Regards, Jolesh

Image

PS: Sorry not sure if I chose the right category

User avatar
Skamiz Kazzarch
Member
Posts: 694
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Isometric images of nodes

by Skamiz Kazzarch » Post

I don't think there is a direct way to get the image as a file
But you can probably use the 'item_image' formspec element to display the node image on a clean background which is easily cropped out.
https://github.com/minetest/minetest/bl ... .txt#L2515

Code: Select all

### `item_image[<X>,<Y>;<W>,<H>;<item name>]`

* Show an inventory image of registered item/node

User avatar
LMD
Member
Posts: 1500
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: Isometric images of nodes

by LMD » Post

I implemented a CSM to do this for https://appgurueu.github.io/online_craftguide/. Needless to say it never made its way into the engine. You could look at tile.cpp to copy the CPU-side inventorycube rendering code. Otherwise you would have to simply render onto a cube using an isometric projection.
My stuff: Projects - Mods - Website

Jolesh
New member
Posts: 8
Joined: Tue Sep 20, 2022 19:54
GitHub: jolesh

Re: Isometric images of nodes

by Jolesh » Post

Hej,
thanks a lot. I made a command to show me the node.
It is not the best solution for extracting big amounts of nodes but works fine for the few I need.
Do you know if there is a way, to make <item name> a parameter so I can add it as a parameter to the command, so I don't have to change the node id in my mods source code?

@LMD Cool, would be nice to create them automatically. Where is the tile.cpp, in one of the github repros linked by Online Craftguide?

User avatar
Skamiz Kazzarch
Member
Posts: 694
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Isometric images of nodes

by Skamiz Kazzarch » Post

The function called by the chat command automatically receives the parameters as a second argument:
https://github.com/minetest/minetest/bl ... .txt#L8849

Code: Select all

        func = function(name, param),
        -- Called when command is run. Returns boolean success and text output.
        -- Special case: The help message is shown to the player if `func`
        -- returns false without a text output.
So you can do something like:

Code: Select all

"item_image[<X>,<Y>;<W>,<H>;" .. param .. "]"

Jolesh
New member
Posts: 8
Joined: Tue Sep 20, 2022 19:54
GitHub: jolesh

Re: Isometric images of nodes

by Jolesh » Post

Thanks a lot :)
I already did the parameter for the command but couldn't figure the syntax out for the item_image.
Now it is all working nice and smoothly.

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: Isometric images of nodes

by bzt » Post

Hi,

I've implemented this in mtsedit. It requires two steps:

1. in game, use the dependency-free mtsedit mod, and in the chat type "/mtsedit imgs", this will save all the texture data to a csv file (will include data for all nodes depending what game / other mods are active, so it works with MTG and MCL too).

2. then outside of the game, run "mtsedit -t thesavedfile.csv", and it will parse that data, find the texture images and generate an isometric PNG for each node.

It isn't perfect though, it does not support all the texture features (like rotated mirrored images etc.), but works most of the time pretty well. Here's a list of PNG images I generated. Example:
Image
For nodes that looks different from different angles (like a stair), it generates an image like this:
Image

Cheers,
bzt

Jolesh
New member
Posts: 8
Joined: Tue Sep 20, 2022 19:54
GitHub: jolesh

Re: Isometric images of nodes

by Jolesh » Post

Hej bzt.
That's quite cool and useful. And 32x32 is exactly the resolution i was looking for, nice. Thanks a lot :)

Cheers, Jolesh

PS: The schemetics look also quite interesting, but the program keeps crashing on me right after start up, I guess I missed sth.

andel1419
New member
Posts: 1
Joined: Fri Oct 21, 2022 11:38
Contact:

Re: Isometric images of nodes

by andel1419 » Post

Is it possible to add in 64x64 resolution?

Jolesh
New member
Posts: 8
Joined: Tue Sep 20, 2022 19:54
GitHub: jolesh

Re: Isometric images of nodes

by Jolesh » Post

Hej,
I just noticed that overlays don't work. So for example: "default_dirt.png^waste_materials_waste_pieces.png" gives me normal dirt. And my nodebox nodes don't have any images at all.
Is that normal/is there a fix?
Regards, Jolesh

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: Isometric images of nodes

by bzt » Post

Jolesh wrote:
Fri Oct 21, 2022 10:26
PS: The schemetics look also quite interesting, but the program keeps crashing on me right after start up, I guess I missed sth.
It's not crashing, it's just your Windows closes the console right away (run in CMD.EXE, and then you'll see it's output, it won't close). This is primarily a command line tool to mass convert schematics into MTS format from batch files.

To get the GUI, you should use the right-click menu's "Open with" "mtsedit.exe" option on a schematic file in explorer (not just .mts, could be Minecraft .schematic or Magicavoxel .vox or Qubicle .qb or WorldEdit .we, whatever).
andel1419 wrote:
Fri Oct 21, 2022 11:43
Is it possible to add in 64x64 resolution?
Well, it is possible, but for now it only generates 32 x 32 images as that's what the editor and the preview generator uses.
Jolesh wrote:
Fri Oct 21, 2022 13:03
I just noticed that overlays don't work. So for example: "default_dirt.png^waste_materials_waste_pieces.png" gives me normal dirt.
Yes, as I've mentioned it isn't perfect, it does not support all the texture features. This was enough for me, and nobody asked for this either, so I haven't implemented `^` yet. The `|` overlay operator does work though.

Cheers,
bzt

User avatar
Hybrid Dog
Member
Posts: 2865
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog
Location: Europe, in the EU where the GDPR applies!

Re: Isometric images of nodes

by Hybrid Dog » Post

It should be possible to use SVG to make the browser show an isometric shaded image of a node with arbitrary zoom and nearest neighbour sampling of the textures (optionally with anti-aliasing) given the 16x16 textures.
It should also be possible to modify and compile Luanti to WebAssembly and run Luanti in the browser to render the inventory images.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests