. This one supports armrest height, which is nice for making high-backed chairs look more realistic. If I put out an OpenZone 1.7 it'll come with it.
Code:
CATEGORY Furniture
PARAM OverhangX FLOAT DEFAULT 0.05 ' Overhang in X direction
PARAM OverhangY FLOAT DEFAULT 0.05 ' Overhang in Y direction
PARAM SeatThick FLOAT DEFAULT 0.05 ' Seat and back thickness
PARAM LegThick FLOAT DEFAULT 0.05 ' Leg thickness
PARAM SeatHeight FLOAT DEFAULT 0.5 ' Seat height
PARAM ArmrestHeight FLOAT DEFAULT 0.25 ' Armrest height
PARAM ArmRests BOOLEAN DEFAULT FALSE
PARAM Frills BOOLEAN DEFAULT FALSE
PARAM Tex1 STRING
PARAM Tex2 STRING DEFAULT Tex1 ' Seat and back covering
VARIABLE I Float
' Seat
Script Box -0.5, -0.5, SeatHeight - SeatThick / 2,
0,0,0,
1,1,SeatThick,
Tex1,Tex1,Tex1,Tex1,Tex1,Tex2;
' Chair back
Script Box -0.5, 0.5 - SeatThick, SeatHeight + SeatThick / 2,
0,0,0,
1, SeatThick, 1 - SeatHeight - SeatThick / 2,
Tex1,Tex1,Tex1,Tex2;
' Legs
Script Box -0.5 + OverhangX, -0.5 + OverhangY, 0,
0,0,0,
LegThick, LegThick, SeatHeight - SeatThick / 2,
Tex1;
Script Box 0.5 - OverhangX - LegThick, -0.5 + OverhangY, 0,
0,0,0,
LegThick, LegThick, SeatHeight - SeatThick / 2,
Tex1;
Script Box -0.5 + OverhangX, 0.5 - OverhangY - LegThick, 0,
0,0,0,
LegThick, LegThick, SeatHeight - SeatThick / 2,
Tex1;
Script Box 0.5 - OverhangX - LegThick, 0.5 - OverhangY - LegThick, 0,
0,0,0,
LegThick, LegThick, SeatHeight - SeatThick / 2,
Tex1;
' Armrests
IF ArmRests
I = ArmrestHeight
If I > 1 - SeatHeight - SeatThick / 2
I = 1 - SeatHeight - SeatThick / 2
EndIf
Script Box -0.5, -0.5 + LegThick, SeatHeight + SeatThick / 2,
0,0,0,
LegThick, LegThick, I - LegThick,
Tex1;
Script Box 0.5 - LegThick, -0.5 + LegThick, SeatHeight + SeatThick / 2,
0,0,0,
LegThick, LegThick, I - LegThick,
Tex1;
Script Box -0.5, -0.5 + LegThick, SeatHeight + SeatThick / 2 + I - LegThick,
0,0,0,
LegThick, 1 - LegThick, LegThick,
Tex1;
Script Box 0.5 - LegThick, -0.5 + LegThick, SeatHeight + SeatThick / 2 + I - LegThick,
0,0,0,
LegThick, 1 - LegThick, LegThick,
Tex1;
ENDIF
' Frills
IF Frills
Script Box -0.5, 0.5 - LegThick, 1,
0,0,0,
LegThick, LegThick, LegThick,
Tex1;
Script Box 0.5 - LegThick, 0.5 - LegThick, 1,
0,0,0,
LegThick, LegThick, LegThick,
Tex1;
ENDIF