adding data to mesh format like adding mount points

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
kariem2k
Gnoblar
Posts: 18
Joined: Sun Jan 09, 2005 10:16 pm
Location: Alexandria, Egypt
Contact:

adding data to mesh format like adding mount points

Post by kariem2k »

hi
can i extend the oger's mesh format to add cutom data like where is weapon mount points or player hit points to indecate damage to the player.
and also can i use blender for exporting to dotscene format and is the meshes in the dotscenes is ordinary ogre meshs.
thanks

User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Re: adding data to mesh format like adding mount points

Post by DWORD »

kariem2k wrote:can i extend the oger's mesh format to add cutom data like where is weapon mount points or player hit points to indecate damage to the player.
No. You have to use another file for that:
sinbad wrote:As I've said shedloads of times on this forum, you should always, always use the MeshSerializer to read and write binary .mesh files. We reserve the right to change the .mesh format any time we feel like it, if you don't use the MeshSerializer that will break your code in all kinds of interesting and creative ways. ;)
http://www.ogre3d.org/phpBB2/viewtopic. ... 2774#52774
kariem2k wrote:and also can i use blender for exporting to dotscene format and is the meshes in the dotscenes is ordinary ogre meshs.
thanks
There's a dotScene blender exporter in ogreaddons CVS.

kariem2k
Gnoblar
Posts: 18
Joined: Sun Jan 09, 2005 10:16 pm
Location: Alexandria, Egypt
Contact:

Post by kariem2k »

thanks for your fast reply
but what can i do to handle this problem(to create mount points for example).

User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

Off the top of my head I would suggest giving the mesh a skeleton, having bones in the skeleton to mark the anchor points. Then in the scene, attach the weapons to these bones, and animate the bones (eg: rotate, etc) to move the weapons.

[edit]
Alternatively, I spose you could have some text file (in xml or some custom format or whatever) which defines the offset that each weapon is to be placed from the center of the mesh.
Then in you app, the mesh has a scene node for moving it around, and when you add a weapon, you give it it's own scene node as a child of the main mesh's scene node, with the defined offset placement as defined in your text file.
[/edit]

kariem2k
Gnoblar
Posts: 18
Joined: Sun Jan 09, 2005 10:16 pm
Location: Alexandria, Egypt
Contact:

Post by kariem2k »

thanks: SuprChikn
i thought in that but how to define offset (what is offset in ogre mesh)
thanks

User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

Offset, as in if you treat the center of you mesh as the origin, what are the co-ordinates needed (in world units) to place the weapon at the correct location.
Store these in the file as mentioned above, then when you attach the weapon in game, do it with the child node thing (again, as mentioned above), and set it's position using the co-ordinates in the text file, using a local transform space for the setPosition function.

kariem2k
Gnoblar
Posts: 18
Joined: Sun Jan 09, 2005 10:16 pm
Location: Alexandria, Egypt
Contact:

Post by kariem2k »

thanks very much
but if there is any suggetions please write
bye

Post Reply