[Mod] 3D Players [3d_player]

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

PilzAdam,
I was working on multiple textures for your 3d players. I noticed the player texture is 'squished' from 32x64 to 32x32. How would I use a 32x64 texture? I setup a couple different textures, setting up the 2d table pixel for pixel (32x64) that had odd results, so I made the textures 32x32 but they lose any detail once they are stretched in game. With this method am I stuck using 32x32 textures and having the game stretch them?

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

The code first creates a node that has the texture and the nodebox and then a entity that has drawtype "wielditem" and is set to the node.
A node needs square textures so I resized the 16x32 texture to 32x32. You should also choose the higher width/height to not loose pixels. The table for the nodebox has to be done for this resized texture.
If you use higher resolutions you may have to change some other parts of the code.
Feel free to ask me if you have any questions.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

PilzAdam wrote:The code first creates a node that has the texture and the nodebox and then a entity that has drawtype "wielditem" and is set to the node.
A node needs square textures so I resized the 16x32 texture to 32x32. You should also choose the higher width/height to not loose pixels. The table for the nodebox has to be done for this resized texture.
If you use higher resolutions you may have to change some other parts of the code.
Feel free to ask me if you have any questions.
Ok I think I know what I did wrong now. Thank you.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

can you make 2 other nodeboxes, the same but with the legs and arms moved a little forward? Then when pos is changing, swap the nodeboxes so it looks like walking is animated.

Josh
Member
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia

by Josh » Post

PilzAdam wrote:
Josh wrote:This look's cool! great job PilzAdam. I thought i could only be made in c++ how did you make it in lua?
With the same "wielditem" hack as for animals. You can use player:set_object_proberties() to change the visuals of the player (somehow like Lua entities).
Would it be possible to have animations to the 3d player? for example a turning head.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

Josh wrote:Would it be possible to have animations to the 3d player? for example a turning head.
I think the only way you can get animation is to swap the nodebox, this means nobeboxes that rotate are not really an option yet.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

There is no (good) way to add animation for the player. Somone is currently working on real 3D players and this mod is just for people who cant wait.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

Can you make them any thicker, say like 5 pixels thick?

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Neuromancer wrote:Can you make them any thicker, say like 5 pixels thick?
You can change it yourself:

Code: Select all

--- 3d_player/init.lua    2012-11-03 14:09:51.542665223 +0100
+++ 3d_player_thick/init.lua    2012-11-03 14:09:18.406664423 +0100
@@ -40,7 +40,7 @@ for i=1,#pix do
         if pix[i][j] == 1 then
             local y = (i-16)*-1+1
             local x = j-16
-            table.insert(box, {(x-1)/32, (y-1)/32, -0.5/32, x/32, y/32, 0.5/32})
+            table.insert(box, {(x-1)/32, (y-1)/32, -2.5/32, x/32, y/32, 2.5/32})
         end
     end
 end


User avatar
terminalerror
Member
Posts: 33
Joined: Tue Oct 30, 2012 22:46
Location: The Sar-Chasm

by terminalerror » Post

PilzAdam wrote:
Neuromancer wrote:Can you make them any thicker, say like 5 pixels thick?
You can change it yourself:

Code: Select all

--- 3d_player/init.lua    2012-11-03 14:09:51.542665223 +0100
+++ 3d_player_thick/init.lua    2012-11-03 14:09:18.406664423 +0100
@@ -40,7 +40,7 @@ for i=1,#pix do
         if pix[i][j] == 1 then
             local y = (i-16)*-1+1
             local x = j-16
-            table.insert(box, {(x-1)/32, (y-1)/32, -0.5/32, x/32, y/32, 0.5/32})
+            table.insert(box, {(x-1)/32, (y-1)/32, -2.5/32, x/32, y/32, 2.5/32})
         end
     end
 end

Oh man! Could you please implement this in your simple mobs mod?
ERROR[main]: ModError: Failed to load and run a sarcastic remark.

mikey2020
Member
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Post

make him thicker i think it really cool tho

mikey2020
Member
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Post

its really cool

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

You're right, PilzAdam. It's VERY time consuming to change the nodebox. Working on a Minecraft player shaped nodebox.

Sokomine
Member
Posts: 4282
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

There are at least two nodebox editors out there: http://minetest.net/forum/viewtopic.php?id=2840 from rubenwardy and
http://minetest.net/forum/viewtopic.php?id=3162 from sapier. Maybe you can get one of them running.
A list of my mods can be found here.

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Here's a nodebox for a "somewhat minecraft" shape. This has not been tested so I don't know what it looks like yet.

Code: Select all

local pix = {
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,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,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,0,0,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0},
}

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

InfinityProject wrote:Here's a nodebox for a "somewhat minecraft" shape. This has not been tested so I don't know what it looks like yet.
[...]
The numbers in the table dont have a effect on the thickness. If there is a 1 it creates a 1 px thick box, nothing else.

Sokomine
Member
Posts: 4282
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

After experimenting a bit with sapiers Wielditem editor I came up with this:
Image
The texture is that of wood (I'm not good at textures!). The collection of nodeboxes is modelled after the image of players on Redcrabs server combined with the default green shape. It looks a bit as if the players are severely undernourished. The image above was taken on the testserver of King Arthurs Land (difficult to do in singleplayer) and works fine if inserted into PilzAdam's mod here.

Can someone come up with a texture for it? Or improve the model? The wood texture doesn't look that great...

You can find the model and a working modified version of PilzAdams mod here: https://github.com/Sokomine/3d_player
A list of my mods can be found here.

mikey2020
Member
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Post

can someone make it the shape and color of a minecraft person

Sokomine
Member
Posts: 4282
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

I don't think copying Minecraft would be such a good idea. Plus the Minecraft player is a figure that is much simpler in construction. I'm afraid it won't look good as a static model. Arms, legs, head...none of these can move yet! For that we'll need the patches MirceaKitsune is working on. But if you really want a character that looks like the one in Minecraft then get the wielditem editor and construct your own set of nodeboxes :-) It's not that difficult.
A list of my mods can be found here.

mikey2020
Member
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Post

i think minecraft would be good you don't have to make the players arms and legs move

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Can you anchor entities to other entities either through lua or some strange lua hack?
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

jordan4ibanez wrote:Can you anchor entities to other entities either through lua or some strange lua hack?
No. But Taoki's 3D player branch includes attachment (anchor) code. I have made a branch of my carts mod that uses this. To test it you have to compile Taoki's 3D player branch and install the attachment branch of my carts mod. Its realy aweseome!

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

This mod is rather useless since 0.4.4-dev has real 3D models.

User avatar
Zeg9
Member
Posts: 608
Joined: Fri Sep 21, 2012 11:02
Location: France

by Zeg9 » Post

PilzAdam wrote:This mod is rather useless since 0.4.4-dev has real 3D models.
Some people is still on 0.4.3
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).

User avatar
pop_harte
Member
Posts: 27
Joined: Sun Mar 23, 2014 07:39

by pop_harte » Post

ow it's like that player?[img]jpgh[/img]

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests