Vertex states in S files

As I understand it TSM just exports objects to 3DS and then calls CONV3DS to convert them to the S format. But I could be wrong.

I don’t know what this particular code could mean. It could be used for some other purpose. Though it sure looks like the andquot;vertex stateandquot; code.

There is an MSTS specific tutorial available in the online help that describes how to use materials with MSTS. As you know, I don’t follow the andquot;named materialsandquot; convention. I think that the tutorial covers everything that you would need to know.

The basics are:

Diffuse isn’t used at all.

Ambient is used to to flip between andquot;Brightandquot; (100) andquot;Half-Brightandquot; (20) and andquot;Darkandquot; (0)

Translucent is used to turn on/off Translucency (vs transparency) and to indicate priority. 2 being high priority, 1 being normal priority (I only have two levels of prioity) and 0 being transparent.

Specular is used to turn on/off specularity. (remembering of course that if you turn off specularity suddenly everything is andquot;brightandquot; at night).

Richard

Apologies if this has been asked before , but I can’t find it anywhere…

Exactly what material lighting factors (D, A, S, T) are used to obtain the appropriate vertex states in the S files? and which of the MSTS 3DS material names to they match ?

I have some code from the developers of [color=LimeGreen:2p6q0hqe]TSM[/color:2p6q0hqe] (!) that shows some correspondance of the numbers…
( -5 andquot;normalandquot; is missing )

[[The material name variations get stuffed into the vtx_state
structure. andnbsp;Here’s a code snippet from ‘TrainSim Modeler’:

andnbsp; andnbsp; andnbsp;if(csMat.Right(6).CompareNoCase(andquot;Brightandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -8;
andnbsp; andnbsp; andnbsp;} else if(csMat.Right(6).CompareNoCase(andquot;CrcFrmandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -9;
andnbsp; andnbsp; andnbsp;} else if(csMat.Right(6).CompareNoCase(andquot;DrkShdandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -12;
andnbsp; andnbsp; andnbsp;} else if(csMat.Right(7).CompareNoCase(andquot;HiShineandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -7;
andnbsp; andnbsp; andnbsp;} else if(csMat.Right(7).CompareNoCase(andquot;LoShineandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -6;
andnbsp; andnbsp; andnbsp;} else if(csMat.Right(6).CompareNoCase(andquot;HlfBrtandquot;) == 0)
andnbsp; andnbsp; andnbsp;{
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;vtx_state.attrib = -11;
andnbsp; andnbsp; andnbsp;}
]]

Regards

Paul

You must be logged in to reply in this thread.

2 posts