Game Development Community

Mesh On in Torque 3d

by TigerHeros · in Torque 3D Professional · 09/21/2010 (9:12 am) · 5 replies

Hi All

I am developing Avatar Customization in Torque 3d.


could any one help me how to show and Hide the mesh

shall i have to compile in c++ to get meshon an meshoff commands. If yes means could any one give me the like for the proper C++ files.

The avatar should change to the selected mesh?.How can i do it?


Thanks in advance

#1
09/21/2010 (10:48 am)
I would like to be able to do this as well. It would be nice if you could share your implementation when you get it working. Maybe this resource would be a good starting point?

www.torquepowered.com/community/resources/view/16807

and this one:

www.torquepowered.com/community/resources/view/5421

and this one:

www.torquepowered.com/community/resources/view/2150

and last but not least, this one:

www.torquepowered.com/community/resources/view/15457

And there you have it, all nice and formatted. Should keep you busy for a while :-)
#2
09/21/2010 (11:01 am)
Those are in per default. All you have to do is remember the command is;

setMeshHidden

so a true will hide it.
and a false will show it.

you can for example have a command working with meshes like this...

function setLegShort(){
%player = localClientConnection.getControlObject();
%player.setMeshHidden("LegTrousers5", false); // will show this
%player.setMeshHidden("LegNoneLeft5", true); // will hide this
}

PS:
the op have not that much to do with materials.
Eric Madisons TSe resource is not needed its in the engine now.
not sure the nodes thins is what he needs.
The TGEA thing is like EM's res. in the engine now ;)
#3
09/22/2010 (10:30 am)
@Steve and Chrsitian Thank you for your reply.

I have used this function

function avatarc()
{
%player = localClientConnection.getControlObject();
%player.setMeshHidden("male_lower02_d", false); // will hide this
%player.setAllMeshesHidden(0);
}

Its not working.

I have dts that consists of all Mesh. But I dont know why it is not working.

Did i had miss something?

Could any one help me? i have to change mesh in torque 3d?

Did any one have sample scripts(zip file) for changing mesh in torque 3d.
#4
09/22/2010 (2:24 pm)
Remove the "%player.setAllMeshesHidden(0);" line. The way you are calling it, it will show all your meshes.
#5
09/22/2010 (3:03 pm)
uhm

Yes, your doing it slightly wrong.
Read what I posted about the function: its a function to hide meshes, so setting it to true will hide, and setting it to false will show.

Quote:%player.setMeshHidden("male_lower02_d", false); // will hide this
That is wrong. false will show it, and not hide it.
%player.setMeshHidden("male_lower02_d", true); // will hide this