<%@ Language=VBScript %><% option explicit %> <% Response.Buffer = FALSE %> <% Response.ContentType = "image/svg+xml" %> <% DIM ScreenWidth, ScreenHeight DIM timeout DIM StageWidth, StageDepth DIM ViewDepth, ViewHeight 'viewpoint relative to stage front and stage floor DIM horizAngle 'arctan of backstage corner / distance from viewer DIM x1, x2 'horizontal distance of backstage corner DIM x3, x4 'screen width units for backstage DIM vertAngleF 'arctan of viewer height / stage front distance DIM vertAngleR 'arctan of viewer height / stage rear distance DIM y1, y2 DIM ScreenMult DIM msg '-- for errors DIM CS_1 'Connection String DIM SID 'sessionID DIM RS_0, RS_1 'RecordSet DIM Q_0, Q_1 'SQL query against the db DIM RWline1, RWline2, RWline3 DIM stage_width_x 'left & right relative to audience DIM stage_depth_y 'front & back relative to audience DIM stage_direction '0=facing audience, increase counterclockwise DIM stage_height 'height of waist above stage (usually claculated) DIM forward_leaning '0=vertical (for humans), increases for forward leaning DIM sideways_leaning '0=vertical (for humans), increases for leaning to the right '' extend the timeout to allow for long files timeout = Server.ScriptTimeout '' Response.Write "Initial timeout=" & timeout & "
" Server.ScriptTimeout = 1200 ScreenWidth = Request.Cookies("Humble")("ScreenWidth") ScreenHeight = Request.Cookies("Humble")("ScreenHeight") CS_1 = "DSN=action" Q_0 = "SELECT * FROM stage" ' Response.Write Q_0 & "
" SET RS_0 = Server.CreateObject("ADODB.Recordset") RS_0.Open Q_0, CS_1, adOpenKeySet, adLockPessimistic, adCmdText '' msg = " *** found data *** " ' IF RS_0.EOF THEN ' msg = " *** no data gen_parent=" & gen_parent & " *** " '' Response.Redirect("http:/help/session.htm") ' END IF ' RS_0.MoveFirst RS_0.Find "param = 'StageDepth'", , 1, 1 StageDepth = RS_0.Fields("value") RS_0.Find "param = 'StageWidth'", , 1, 1 StageWidth = RS_0.Fields("value") RS_0.Find "param = 'ViewDepth'", , 1, 1 ViewDepth = RS_0.Fields("value") RS_0.Find "param = 'ViewHeight'", , 1, 1 ViewHeight = RS_0.Fields("value") ScreenMult = 20000 / StageWidth 'screenUnits = metre * ScreenMult '---- calculate and set up the stage --- ' horizontal angles and screen distances horizAngle = ATN( (StageWidth/2) / (StageDepth+ViewDepth)) 'angle of view to right rear corner x1 = TAN( horizAngle) * ViewDepth 'from centre to intersection of view with front stage x2 = x1 * ScreenMult 'convert m to screen units x3 = 11750 - x2 'relative to centre: left corner = centre - x2 x4 = x2 / 10 ' vertical angles and screen distances ' vertAngleF = ATN( ViewHeight / ViewDepth) vertAngleR = ATN( ViewHeight / (ViewDepth+StageDepth)) y1 = TAN( vertAngleR) * StageDepth y2 = y1 * ScreenMult 'convert m to screen units '-- population -- ' RS_1.MoveLast ' use mm as dimensions, using the same scale for horizontal and vertical ' set it up for a graph bounding box of 20000 horizontal by 10000 vertical ' for a stage of 20m by 20m, it is 1mm per graphing unit, 1000 units per m ' the viewBox has to be larger, to allow for left (and right?) parameter stuff ' the graph should have 20 by 10 internal dividers (grid pattern) %> stage width: -<%=(StageWidth/2)%>mm 0,0 (width, depth) stage width: <%=(StageWidth/2)%>mm height above stage=0 height above stage=0 stage depth=0 stage depth=<%=(StageDepth)%>mm <%'----------------------------------------------------------------------%> <% Q_1 = "SELECT * FROM position_Pose" ' Response.Write Q_1 & "
" SET RS_1 = Server.CreateObject("ADODB.Recordset") RS_1.Open Q_1, CS_1, adOpenKeySet, adLockPessimistic, adCmdText RS_1.Find "param = 'stage_width_x'", , 1, 1 stage_width_x = RS_1.Fields("value") RS_1.Find "param = 'stage_depth_y'", , 1, 1 stage_depth_y = RS_1.Fields("value") RS_1.Find "param = 'stage_direction'", , 1, 1 stage_direction = RS_1.Fields("value") RS_1.Find "param = 'stage_height'", , 1, 1 stage_height = RS_1.Fields("value") RS_1.Find "param = 'forward_leaning'", , 1, 1 forward_leaning = RS_1.Fields("value") RS_1.Find "param = 'sideways_leaning'", , 1, 1 sideways_leaning = RS_1.Fields("value") '---- calculate and set up the stage position for the actor --- ' horizontal angles and screen distances horizAngle = ATN( stage_width_x / (ViewDepth+stage_depth_y)) 'angle to position x1 = TAN( horizAngle) * ViewDepth 'from centre to intersection of view with front stage x2 = x1 * ScreenMult 'convert m to screen units x3 = 11750 + x2 'relative to centre: left side = centre - x2 ' vertical angles and screen distances ' vertAngleF = ATN( ViewHeight / ViewDepth) vertAngleR = ATN( ViewHeight / (ViewDepth+stage_depth_y)) y1 = TAN( vertAngleR) * stage_depth_y y2 = y1 * ScreenMult 'convert m to screen units %> <%'----------------------------------------------------------------------%> position on the stage, indicated as a vertical line from the centre of gravity (waist) to the stage floor viewer at width=0, depth= -<%=ViewDepth%>mm from front edge of stage, eye height = <%=ViewHeight%>mm above the stage; -- actor at width=<%=stage_width_x%>mm, depth=<%=stage_depth_y%>mm, and <%=stage_height%>mm to waist <%'----------------------------------------------------------------------%> <%'----------------------------------------------------------------------%> <% '' reset the timeout Server.ScriptTimeout = timeout Response.End '-----------------------------------------------------------%>