The draw code of the waiting room draws the floor and red box whenever the input ports are closed. There's not an easy way to tell it not to draw the floor without writing custom draw code.
I would recommend you not even use this method of closing and opening ports to perform batching and instead use the method in this answer.
If you really want to override the draw code here's the draw code from the object without the drawfloor part, you should be able to paste this into the object's draw trigger:
//////////////////////////////////// CODE HEADER //////////////////////////////////////////////////////////////////////
treenode current = ownerobject(c);
treenode view = parnode(1);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
fglPushMatrix();
drawtomodelscale(current);
fglDisable(GL_TEXTURE_2D);
double r = get(rank(color(current),1));
double g = get(rank(color(current),2));
double b = get(rank(color(current),3));
double rotation = 0;
int nrofbays = content(getvarnode(current, "contenttable"));
//size of chair graphic
double chairWidth = 0.713;
double chairDepth = 0.645;
double chairHeight = 1.07;
for(int bay = 1; bay <= nrofbays; bay++)
{
double bayloc = get(rank(getvarnode(current, "locationtable"), bay));
treenode curBayNode = rank(getvarnode(current, "sizetable"), bay);
double baysize = get(curBayNode);
int nroflevels = content(rank(getvarnode(current, "contenttable"), bay));
double deltax = 0;
double deltay = 0;
for(int level = 1; level <= nroflevels; level++)
{
// Each row in the sizetable is a bay and is a head node of yet another table with a row
// for each level of the bay, and two column. In the first column is the height of the
// level (i.e. length of the bay's "Position") and the second column contains the orientation
// of the graphic at that position.
double levelsize = gettablenum(curBayNode, level, 1);
int orientation = gettablenum(curBayNode, level, 2);
double levelloc = gettablenum(getvarnode(current, "locationtable"), bay, level);
// Subtract leveloc from ysize to correct for opposite y direction in object's coordinate system,
// and subtract levelsize to correct for level size.
levelloc = (ysize(current) - levelloc) - levelsize;
// Determine the deltax,deltay vectors from the origin of each cell (i.e. position) to the
// front-left corner of the graphic (i.e. chair). The origin of the cell is the top-left
// corner of the cell when viewed from a model top view where model positive x is to the right
// and positive y is up. However the deltay vector's positive direction would be down.
// The 0.04 and 0.02 adjustments to deltax/deltay that are used below are necessary because
// the chair shape in the 3DS file is shifted 0.02 meters to the right size of the chair,
// and 0.04 meters to the front of the chair.
switch(orientation)
{
case ORIENTATION_RIGHT: // 3 1
{
deltax = chairDepth - 0.04;
deltay = (levelsize-chairWidth) - 0.02;
rotation = -90;
break;
}
case ORIENTATION_FORWARD: // 1 2
{
deltax = 0 - 0.02;
deltay = (levelsize-chairDepth) + 0.04;
rotation = 0;
break;
}
case ORIENTATION_LEFT: // 2 3
{
deltax = 0 + 0.04;
deltay = levelsize + 0.02;
rotation = 90;
break;
}
case ORIENTATION_BACKWARD: // 4
{
deltax = chairWidth + 0.02;
deltay = levelsize - 0.04;
rotation = 180;
break;
}
}
fglPushMatrix();
fglTranslate(bayloc + deltax, 0, levelloc + deltay); // flexsim x, -z, y
fglRotate(rotation, 0,1,0);
// I don't know the origin of the following x,z,y scale factors. They're a little off from the sx,sy,sz
// of the actual graphic in the model (as used above), but thought I ought to keep the scale of
// the graphic in the model unchanged because it fits the patients fairly well.
fglScale(0.75, 0.97, 0.68);
fglColor(r,g,b);
drawobject(view, getvarnum(current, "CurShapeIndex"), 0);
fglPopMatrix();
}
}
fglPopMatrix();
fglEnable(GL_TEXTURE_2D);
return 1;
Matthew Gillespie
FlexSim Software Developer