Merge pull request #22 from benrob0329/master

Update UFO model to ufo.obj and change code
master
cd2 2016-05-16 10:45:25 +02:00
commit 4145801e35
6 changed files with 96 additions and 14 deletions

View File

@ -41,3 +41,6 @@ Wuzzy (WTFPL):
levelnodes_cushion_top.png
levelnodes_cushion_side.png
levelnodes_cushion_bottom.png
Benrob0329 (CC0)
ufo.obj

View File

@ -199,14 +199,14 @@ if use_entity then
else
minetest.register_on_joinplayer(function(player)
player:set_properties({
mesh = "ufo.x",
textures = {"ufo_skin.png",},
visual = "mesh",
visual_size = {x=1, y=1},
})
uforun.player_set_model(player, "ufo.obj", "uforun_ufo.png")
player:set_eye_offset({x=0,y=-10,z=0},{x=0,y=0,z=0})
player:set_inventory_formspec(uforun.inv_form)
end)
minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do
local pos = player:getpos()

Binary file not shown.

View File

@ -0,0 +1,85 @@
# Blender v2.77 (sub 0) OBJ File: ''
# www.blender.org
mtllib ufo.mtl
o Cube
v -3.116000 -0.017911 -3.116000
v -3.116000 -0.017911 3.116000
v 3.116000 -0.017911 3.116000
v 3.116000 -0.017911 -3.116000
v -3.116000 -5.000000 3.116000
v 3.116000 -5.000000 3.116000
v 3.116000 -5.000000 -3.116000
v -3.116000 -5.000000 -3.116000
v -5.002470 -9.982090 -5.002470
v -5.002470 -5.000000 -5.002470
v 5.002470 -5.000000 -5.002470
v 5.002470 -9.982090 -5.002470
v 5.002470 -9.982090 5.002470
v 5.002470 -5.000000 5.002470
v -5.002470 -5.000000 5.002470
v -5.002470 -9.982090 5.002470
vt 0.250000 0.483871
vt 0.250000 0.741935
vt -0.000000 0.741935
vt -0.000000 0.483871
vt 1.000000 0.741935
vt 0.750000 0.741935
vt 0.750000 0.483871
vt 1.000000 0.483871
vt 0.625000 0.225806
vt 0.625000 0.483871
vt 0.500000 0.483871
vt 0.500000 0.225806
vt 0.500000 0.483871
vt 0.500000 0.741935
vt 0.046875 0.741935
vt 0.203125 0.741935
vt 0.203125 1.000000
vt 0.046875 1.000000
vt 0.000000 0.483871
vt 0.000000 0.000000
vt 0.250000 0.000000
vt 0.250000 0.483871
vt 0.953125 0.741935
vt 0.953125 1.000000
vt 0.796875 1.000000
vt 0.796875 0.741935
vt 0.250000 0.000000
vt 0.500000 0.000000
vt 0.546875 1.000000
vt 0.546875 0.741935
vt 0.703125 0.741935
vt 0.703125 1.000000
vt 0.625000 0.225806
vt 0.625000 0.483871
vt 0.750000 0.483871
vt 0.750000 0.225806
vt 0.296875 0.741935
vt 0.453125 0.741935
vt 0.453125 1.000000
vt 0.296875 1.000000
vn -0.577400 -0.577400 0.577400
vn -0.577400 0.577400 0.577400
vn -0.750900 0.344800 -0.563300
vn -0.577400 -0.577400 -0.577400
vn 0.577400 0.577400 -0.577400
vn 0.577400 -0.577400 -0.577400
vn 0.577400 0.577400 0.577400
vn -0.577400 0.577400 -0.577400
vn 0.519100 -0.357300 0.776500
vn 0.471600 0.421800 0.774400
vn 0.577400 -0.577400 0.577400
usemtl Material
s 1
f 16/1/1 15/2/2 10/3/3 9/4/4
f 10/5/3 11/6/5 12/7/6 9/8/4
f 3/9/7 4/10/5 1/11/8 2/12/2
f 16/1/1 13/13/9 14/14/10 15/2/2
f 8/15/4 5/16/1 2/17/2 1/18/8
f 10/19/3 15/20/2 14/21/10 11/22/5
f 7/23/6 8/24/4 1/25/8 4/26/5
f 9/27/4 12/28/6 13/13/9 16/1/1
f 6/29/11 7/30/6 4/31/5 3/32/7
f 5/33/1 8/34/4 7/35/6 6/36/11
f 13/13/9 12/7/6 11/6/5 14/14/10
f 5/37/1 6/38/11 3/39/7 2/40/2

View File

@ -3,11 +3,11 @@ uforun.gui.bg = "bgcolor[#666666;false]"
uforun.gui.colors = "listcolors[#333333FF;#101010FF;#000000FF;#68B259;#FFF]"
-- Called when a player's appearance needs to be updated
function uforun.player_set_model(player, model_name)
function uforun.player_set_model(player, model_name, texture_name)
local name = player:get_player_name()
player:set_properties({
mesh = model_name,
textures = {"uforun_ufo.png"},
textures = {texture_name},
visual = "mesh",
collisionbox = {-0.5,-1,-0.5, 0.5,0.0,0.5},
visual_size = {x=1, y=1},
@ -19,12 +19,6 @@ uforun.inv_form = uforun.inv_form..uforun.gui.colors
uforun.inv_form = uforun.inv_form..uforun.gui.bg
uforun.inv_form = uforun.inv_form.."list[current_player;main;0,3;8,4;]"
minetest.register_on_joinplayer(function(player)
uforun.player_set_model(player, "ufo.b3d")
player:set_eye_offset({x=0,y=-10,z=0},{x=0,y=0,z=0})
player:set_inventory_formspec(uforun.inv_form)
end)
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 559 B