%@ 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 RS_0, Q_0, SID 'RecordSet, Query - for sessionID
DIM RS_1, RS_2, RS_3, RS_4, RS_5 'RecordSet
DIM Q_1, Q_2, Q_3, Q_4, Q_5 'SQL query against the db
DIM RWline1, RWline2, RWline3
'' 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_.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 = 2000 / StageWidth 'screenUnits = metre * ScreenMult
' 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 = 1175 - 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
' set it up for a graph bounding box of 2000 horizontal by 1000 vertical
' 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)
%>
<%
'' reset the timeout
Server.ScriptTimeout = timeout
Response.End '-----------------------------------------------------------%>