%
'This is an asp version of Phineus's Perl Online Tiremaker.
'# web based tiremaker program
'# requires parameters
'# 0. step
'# 1. number of circles
'# 2. number of points on each circles
'# 3. array of pos
'# 4. array of radii
'use CGI qw(:standard);
step = Request.QueryString("step")
numCir = Request.QueryString("circles")
numPnt = Request.QueryString("points")
'# ---------- Program Flow ----------
If Step = 1 Then
DoStep1
ElseIf Step = 2 Then
DoStep2
ElseIf Step = 3 Then
'FileSystemObject.OpenTextFile(fname,mode,create,format)
'Modes:
ForReading = 1
ForWriting = 2
ForAppending = 8
'recreation of m2kcounter.asp
pgeNme = Request.ServerVariables("PATH_INFO")
'response.write("
pgeNme: " & pgeNme & "
") 'pgeNme = Replace(pgeNme,"/","_") 'pgeNme = Replace(pgeNme,"\","_") LogTo = left(pgeNme,len(pgeNme)-7) & "ObjCounter.txt" CounterFile = Server.MapPath(LogTo) 'response.write("
CounterFile: " & CounterFile & "
") Set xFS = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set xMC = xFS.OpenTextFile(CounterFile, 1, 0, 0) usercnt = xMC.Readline set xFS = Nothing usercnt = FormatNumber(usercnt + 1,0) Set xFS = CreateObject("Scripting.FileSystemObject") set xRC = xFS.CreateTextFile (CounterFile, 1, 0) xRC.WriteLine usercnt Set xRC = Nothing showHitCnt = usercnt response.write("
This does the same thing as BinMasta's TireMaker program but runs as a web page. Follow the prompts, then copy and paste the results into a text document using an .obj extension.
<% End Sub Sub DoStep2 %>
This does the same thing as BinMasta's TireMaker program but runs as a web page. Follow the prompts, then copy and paste the results into a text document using an .obj extension.
<% End Sub Sub DoStep3 set fso=Server.CreateObject("Scripting.FileSystemObject") set objFile=fso.OpenTextFile(Server.MapPath(left(pgeNme,len(pgeNme)-7) & showHitCnt & ".obj"),ForWriting,true) pi = 3.1415926535897932384626433832795 'angleShift = 360 / numPnt Use this for Degrees angleShift = 2 * pi / numPnt 'ignore the three lines below this, it's irrelivent. 'Gotta load the Arrays somwhere here! ARUGH! Or just pop them l8r. array of pos - array of radii 'radius = Request.QueryString("r") 'zPos = Request.QueryString("p") '# Verticies objFile.WriteLine("v 0 0 " & 10000*Request.QueryString("p1")) 'Response.Write("v 0 0 " & 10000*Request.QueryString("p1") & "<% End Sub '
' NumbOfSec = N
' AngleShift = 360 / NumbOfSec
' XOffset = X
' YOffset = Y
' Raduis = R
' XPoisition = (Raduis * sin( AngleShift * n )) + XOffset
' YPosition = (Raduis * cos( AngleShift * n )) + YOffset
' Where n is the line number (0..NumbOfSec-1).
' This assumes that your sin/cos functions are working in degrees.
' If they are in radians then change:
' AngleShift = 360 / NumbOfSec
' to:
' AngleShift = 2*PI / NumbOfSec
' Note. Perl uses radians.
' So does VB ;-)
%>