Page 1 of 1

Static simple 3d meshes

PostPosted: Mon Feb 18, 2013 06:57
by Badger436
Hi everyone, first of all, I'm glad to be here. I just joined the forums and I think that this is a really neat game. I am curious to learn how to add simple low-poly static meshes into the game. For example, I have made a model of an anvil, and would like it to be able to be placed in the world. I have added many different 2D items without any problems. I would like to now attempt a 3D version of one of my items. There is no animation involved, just the item itself, which (the plan is) will be possible to interact with in the place of a block-- similar to the furnace.

What I am unsure of:

--best format to use for static, non-animated meshes?
--how to implement these items in the lua script to where they are placeable in the world?

Thank you in advance!

PostPosted: Mon Feb 18, 2013 07:13
by PilzAdam
Nodes cant have meshes. There are predefined drawtypes wich hare handled by the engine.
One of the drawtype is called "nodebox". You can define multiple little boxes wich are drawn (see stairs for example).

PostPosted: Mon Feb 18, 2013 16:27
by lkjoel
Clarifiying PilzAdam's answer: You can have a node that draws a mesh as its drawtype (see player.lua in the default mod). It doesn't allow you to have collision detection though, so you would want to make a nodebox (but don't set the drawtype as nodebox, if you want the mesh to be drawn).

EDIT: Okay, apparently not...

PostPosted: Mon Feb 18, 2013 16:29
by PilzAdam
lkjoel wrote:Clarifiying PilzAdam's answer: You can have a node that draws a mesh as its drawtype (see player.lua in the default mod). It doesn't allow you to have collision detection though, so you would want to make a nodebox (but don't set the drawtype as nodebox, if you want the mesh to be drawn).

The player is an object. Nodes cant have meshes, only active objects can.

PostPosted: Mon Feb 18, 2013 16:30
by lkjoel
PilzAdam wrote:
lkjoel wrote:Clarifiying PilzAdam's answer: You can have a node that draws a mesh as its drawtype (see player.lua in the default mod). It doesn't allow you to have collision detection though, so you would want to make a nodebox (but don't set the drawtype as nodebox, if you want the mesh to be drawn).

The player is an object. Nodes cant have meshes, only active objects can.

Oh really? I thought they could... Why can't they?

PostPosted: Thu Feb 21, 2013 03:59
by Badger436
Thank you very much for the clarification!

PostPosted: Thu Feb 21, 2013 13:13
by Traxie21
It is kind of easy to create an object that behaves like a block