//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
//TESH.scrollpos=42
//TESH.alwaysfold=0
library Table /* made by Bribe, special thanks to Vexorian & Nestharus, version 3.1.1.0
One map, one hashtable. Welcome to NewTable 3.1
This library was originally called NewTable so it didn't conflict with
the API of Table by Vexorian. However, the damage is done and it's too
late to change the library name now. To help with damage control, I
have provided an extension library called TableBC, which bridges all
the functionality of Vexorian's Table except for 2-D string arrays &
the ".flush(integer)" method. I use ".flush()" to flush a child hash-
table, because I wanted the API in NewTable to reflect the API of real
hashtables (I thought this would be more intuitive).
API
------------
struct Table
| static method create takes nothing returns Table
| create a new Table
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush all stored values inside of it
|
| method remove takes integer key returns nothing
| remove the value at index "key"
|
| method operator []= takes integer key, $TYPE$ value returns nothing
| assign "value" to index "key"
|
| method operator [] takes integer key returns $TYPE$
| load the value at index "key"
|
| method has takes integer key returns boolean
| whether or not the key was assigned
|
----------------
struct TableArray
| static method operator [] takes integer array_size returns TableArray
| create a new array of Tables of size "array_size"
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush and destroy it
|
| method operator size takes nothing returns integer
| returns the size of the TableArray
|
| method operator [] takes integer key returns Table
| returns a Table accessible exclusively to index "key"
*/
globals
private integer less = 0 //Index generation for TableArrays (below 0).
private integer more = 8190 //Index generation for Tables.
//Configure it if you use more than 8190 "key" variables in your map (this will never happen though).
private hashtable ht = InitHashtable()
private key sizeK
private key listK
endglobals
private struct dex extends array
static method operator size takes nothing returns Table
return sizeK
endmethod
static method operator list takes nothing returns Table
return listK
endmethod
endstruct
private struct handles extends array
method has takes integer key returns boolean
return HaveSavedHandle(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSavedHandle(ht, this, key)
endmethod
endstruct
private struct agents extends array
method operator []= takes integer key, agent value returns nothing
call SaveAgentHandle(ht, this, key, value)
endmethod
endstruct
//! textmacro NEW_ARRAY_BASIC takes SUPER, FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$(ht, this, key, value)
endmethod
method has takes integer key returns boolean
return HaveSaved$SUPER$(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSaved$SUPER$(ht, this, key)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//! textmacro NEW_ARRAY takes FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$Handle(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$Handle(ht, this, key, value)
endmethod
method has takes integer key returns boolean
return HaveSavedHandle(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSavedHandle(ht, this, key)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//Run these textmacros to include the entire hashtable API as wrappers.
//Don't be intimidated by the number of macros - Vexorian's map optimizer is
//supposed to kill functions which inline (all of these functions inline).
//! runtextmacro NEW_ARRAY_BASIC("Real", "Real", "real")
//! runtextmacro NEW_ARRAY_BASIC("Boolean", "Boolean", "boolean")
//! runtextmacro NEW_ARRAY_BASIC("String", "Str", "string")
//New textmacro to allow table.integer[] syntax for compatibility with textmacros that might desire it.
//! runtextmacro NEW_ARRAY_BASIC("Integer", "Integer", "integer")
//! runtextmacro NEW_ARRAY("Player", "player")
//! runtextmacro NEW_ARRAY("Widget", "widget")
//! runtextmacro NEW_ARRAY("Destructable", "destructable")
//! runtextmacro NEW_ARRAY("Item", "item")
//! runtextmacro NEW_ARRAY("Unit", "unit")
//! runtextmacro NEW_ARRAY("Ability", "ability")
//! runtextmacro NEW_ARRAY("Timer", "timer")
//! runtextmacro NEW_ARRAY("Trigger", "trigger")
//! runtextmacro NEW_ARRAY("TriggerCondition", "triggercondition")
//! runtextmacro NEW_ARRAY("TriggerAction", "triggeraction")
//! runtextmacro NEW_ARRAY("TriggerEvent", "event")
//! runtextmacro NEW_ARRAY("Force", "force")
//! runtextmacro NEW_ARRAY("Group", "group")
//! runtextmacro NEW_ARRAY("Location", "location")
//! runtextmacro NEW_ARRAY("Rect", "rect")
//! runtextmacro NEW_ARRAY("BooleanExpr", "boolexpr")
//! runtextmacro NEW_ARRAY("Sound", "sound")
//! runtextmacro NEW_ARRAY("Effect", "effect")
//! runtextmacro NEW_ARRAY("UnitPool", "unitpool")
//! runtextmacro NEW_ARRAY("ItemPool", "itempool")
//! runtextmacro NEW_ARRAY("Quest", "quest")
//! runtextmacro NEW_ARRAY("QuestItem", "questitem")
//! runtextmacro NEW_ARRAY("DefeatCondition", "defeatcondition")
//! runtextmacro NEW_ARRAY("TimerDialog", "timerdialog")
//! runtextmacro NEW_ARRAY("Leaderboard", "leaderboard")
//! runtextmacro NEW_ARRAY("Multiboard", "multiboard")
//! runtextmacro NEW_ARRAY("MultiboardItem", "multiboarditem")
//! runtextmacro NEW_ARRAY("Trackable", "trackable")
//! runtextmacro NEW_ARRAY("Dialog", "dialog")
//! runtextmacro NEW_ARRAY("Button", "button")
//! runtextmacro NEW_ARRAY("TextTag", "texttag")
//! runtextmacro NEW_ARRAY("Lightning", "lightning")
//! runtextmacro NEW_ARRAY("Image", "image")
//! runtextmacro NEW_ARRAY("Ubersplat", "ubersplat")
//! runtextmacro NEW_ARRAY("Region", "region")
//! runtextmacro NEW_ARRAY("FogState", "fogstate")
//! runtextmacro NEW_ARRAY("FogModifier", "fogmodifier")
//! runtextmacro NEW_ARRAY("Hashtable", "hashtable")
struct Table extends array
// Implement modules for intuitive syntax (tb.handle; tb.unit; etc.)
implement realm
implement integerm
implement booleanm
implement stringm
implement playerm
implement widgetm
implement destructablem
implement itemm
implement unitm
implement abilitym
implement timerm
implement triggerm
implement triggerconditionm
implement triggeractionm
implement eventm
implement forcem
implement groupm
implement locationm
implement rectm
implement boolexprm
implement soundm
implement effectm
implement unitpoolm
implement itempoolm
implement questm
implement questitemm
implement defeatconditionm
implement timerdialogm
implement leaderboardm
implement multiboardm
implement multiboarditemm
implement trackablem
implement dialogm
implement buttonm
implement texttagm
implement lightningm
implement imagem
implement ubersplatm
implement regionm
implement fogstatem
implement fogmodifierm
implement hashtablem
method operator handle takes nothing returns handles
return this
endmethod
method operator agent takes nothing returns agents
return this
endmethod
//set this = tb[GetSpellAbilityId()]
method operator [] takes integer key returns Table
return LoadInteger(ht, this, key) //return this.integer[key]
endmethod
//set tb[389034] = 8192
method operator []= takes integer key, Table tb returns nothing
call SaveInteger(ht, this, key, tb) //set this.integer[key] = tb
endmethod
//set b = tb.has(2493223)
method has takes integer key returns boolean
return HaveSavedInteger(ht, this, key) //return this.integer.has(key)
endmethod
//call tb.remove(294080)
method remove takes integer key returns nothing
call RemoveSavedInteger(ht, this, key) //call this.integer.remove(key)
endmethod
//Remove all data from a Table instance
method flush takes nothing returns nothing
call FlushChildHashtable(ht, this)
endmethod
//local Table tb = Table.create()
static method create takes nothing returns Table
local Table this = dex.list[0]
if this == 0 then
set this = more + 1
set more = this
else
set dex.list[0] = dex.list[this]
call dex.list.remove(this) //Clear hashed memory
endif
debug set dex.list[this] = -1
return this
endmethod
// Removes all data from a Table instance and recycles its index.
//
// call tb.destroy()
//
method destroy takes nothing returns nothing
debug if dex.list[this] != -1 then
debug call BJDebugMsg("Table Error: Tried to double-free instance: " + I2S(this))
debug return
debug endif
call this.flush()
set dex.list[this] = dex.list[0]
set dex.list[0] = this
endmethod
//! runtextmacro optional TABLE_BC_METHODS()
endstruct
//! runtextmacro optional TABLE_BC_STRUCTS()
struct TableArray extends array
//Returns a new TableArray to do your bidding. Simply use:
//
// local TableArray ta = TableArray[array_size]
//
static method operator [] takes integer array_size returns TableArray
local Table tb = dex.size[array_size] //Get the unique recycle list for this array size
local TableArray this = tb[0] //The last-destroyed TableArray that had this array size
debug if array_size <= 0 then
debug call BJDebugMsg("TypeError: Invalid specified TableArray size: " + I2S(array_size))
debug return 0
debug endif
if this == 0 then
set this = less - array_size
set less = this
else
set tb[0] = tb[this] //Set the last destroyed to the last-last destroyed
call tb.remove(this) //Clear hashed memory
endif
set dex.size[this] = array_size //This remembers the array size
return this
endmethod
//Returns the size of the TableArray
method operator size takes nothing returns integer
return dex.size[this]
endmethod
//This magic method enables two-dimensional[array][syntax] for Tables,
//similar to the two-dimensional utility provided by hashtables them-
//selves.
//
//ta[integer a].unit[integer b] = unit u
//ta[integer a][integer c] = integer d
//
//Inline-friendly when not running in debug mode
//
method operator [] takes integer key returns Table
static if DEBUG_MODE then
local integer i = this.size
if i == 0 then
call BJDebugMsg("IndexError: Tried to get key from invalid TableArray instance: " + I2S(this))
return 0
elseif key < 0 or key >= i then
call BJDebugMsg("IndexError: Tried to get key [" + I2S(key) + "] from outside TableArray bounds: " + I2S(i))
return 0
endif
endif
return this + key
endmethod
//Destroys a TableArray without flushing it; I assume you call .flush()
//if you want it flushed too. This is a public method so that you don't
//have to loop through all TableArray indices to flush them if you don't
//need to (ie. if you were flushing all child-keys as you used them).
//
method destroy takes nothing returns nothing
local Table tb = dex.size[this.size]
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to destroy an invalid TableArray: " + I2S(this))
debug return
debug endif
if tb == 0 then
//Create a Table to index recycled instances with their array size
set tb = Table.create()
set dex.size[this.size] = tb
endif
call dex.size.remove(this) //Clear the array size from hash memory
set tb[this] = tb[0]
set tb[0] = this
endmethod
private static Table tempTable
private static integer tempEnd
//Avoids hitting the op limit
private static method clean takes nothing returns nothing
local Table tb = .tempTable
local integer end = tb + 0x1000
if end < .tempEnd then
set .tempTable = end
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
else
set end = .tempEnd
endif
loop
call tb.flush()
set tb = tb + 1
exitwhen tb == end
endloop
endmethod
//Flushes the TableArray and also destroys it. Doesn't get any more
//similar to the FlushParentHashtable native than this.
//
method flush takes nothing returns nothing
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to flush an invalid TableArray instance: " + I2S(this))
debug return
debug endif
set .tempTable = this
set .tempEnd = this + this.size
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
call this.destroy()
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
/* LIBRARY BY ashujon
you can find it here http://www.wc3c.net/showthread.php?t=102351
*/
library Math initializer Init
struct VECTOR3
static VECTOR3 Zero
static VECTOR3 oneX
static VECTOR3 oneY
static VECTOR3 oneZ
real x
real y
real z
static method New_0 takes nothing returns VECTOR3 //create an empty vector
local VECTOR3 this = VECTOR3.create()
set .x = 0
set .y = 0
set .z = 0
return this
endmethod
static method New_1 takes real x, real y, real z returns VECTOR3 //create a new vector based on given values
local VECTOR3 this = VECTOR3.create()
set .x = x
set .y = y
set .z = z
return this
endmethod
method vec3Assign takes real x ,real y, real z returns nothing
set .x = x
set .y = y
set .z = z
endmethod
static method New_2 takes VECTOR3 v returns VECTOR3 //copy an existing vector
local VECTOR3 this = VECTOR3.create()
set .x = v.x
set .y = v.y
set .z = v.z
return this
endmethod
method Length takes nothing returns real //returns the length of a vector
return SquareRoot(.x*.x+.y*.y+.z*.z)
endmethod
method LengthSq takes nothing returns real
return .x*.x+.y*.y+.z*.z
endmethod
method ToString takes nothing returns string //returns the values of a given vector
return "Vector3 id "+I2S(this) + "\nx = "+R2S(.x)+" y = "+R2S(.y)+" z = "+R2S(.z)
endmethod
static method create takes nothing returns VECTOR3
local VECTOR3 this = VECTOR3.allocate()
return this
endmethod
endstruct
function Vec3Add takes VECTOR3 Output, VECTOR3 v1, VECTOR3 v2 returns VECTOR3 //adds 2 3d vectors and writes the output in a new vector
set Output.x = v1.x + v2.x
set Output.y = v1.y + v2.y
set Output.z = v1.z + v2.z
return Output
endfunction
function Vec3Subtract takes VECTOR3 Output, VECTOR3 v1, VECTOR3 v2 returns VECTOR3 //calculates the distance between 2 3d vectors' endpoints
set Output.x = v1.x - v2.x
set Output.y = v1.y - v2.y
set Output.z = v1.z - v2.z
return Output
endfunction
function Vec3Scale takes VECTOR3 Output, VECTOR3 v, real r returns VECTOR3 //scales a 3d vector making it longer
set Output.x = v.x * r
set Output.y = v.y * r
set Output.z = v.z * r
return Output
endfunction
function Vec3Division takes VECTOR3 Output, VECTOR3 v, real r returns VECTOR3 //makes 3d vector shorter
set Output.x = v.x / r
set Output.y = v.y / r
set Output.z = v.z / r
return Output
endfunction
function Vec3Length takes VECTOR3 v returns real
return SquareRoot(v.x*v.x+v.y*v.y+v.z*v.z)
endfunction
function Vec3LengthSq takes VECTOR3 v returns real
return v.x*v.x+v.y*v.y+v.z*v.z
endfunction
function Vec3Normalize takes VECTOR3 Output, VECTOR3 v returns VECTOR3
local real len = SquareRoot(v.x*v.x+v.y*v.y+v.z*v.z)
set Output.x = v.x/len
set Output.y = v.y/len
set Output.z = v.z/len
return Output
endfunction
function Vec3Dot takes VECTOR3 v1, VECTOR3 v2 returns real
return v1.x*v2.x+v1.y*v2.y+v1.z*v2.z
endfunction
function Vec3Cross takes VECTOR3 Output, VECTOR3 v1, VECTOR3 v2 returns VECTOR3
local real y = v1.z * v2.x - v1.x * v2.z
local real z = v1.x * v2.y - v1.y * v2.x
set Output.x = v1.y * v2.z - v1.z * v2.y
set Output.y = y
set Output.z = z
return Output
endfunction
function Vec3Transform_1 takes VECTOR3 Output, VECTOR3 v, MATRIX3 m returns VECTOR3
local real y = v.x*m.m12+v.y*m.m22+v.z*m.m32
local real z = v.x*m.m13+v.y*m.m23+v.z*m.m33
set Output.x = v.x*m.m11+v.y*m.m21+v.z*m.m31
set Output.y = y
set Output.z = z
return Output
endfunction
function Vec3Transform_2 takes VECTOR3 Output, VECTOR3 v, MATRIX4 m returns VECTOR3
local real y = v.x*m.m12+v.y*m.m22+v.z*m.m32+m.m42
local real z = v.x*m.m13+v.y*m.m23+v.z*m.m33+m.m43
local real w = v.x*m.m14+v.y*m.m24+v.z*m.m34+m.m44
set Output.x = (v.x*m.m11+v.y*m.m21+v.z*m.m31+m.m41)/w
set Output.y = y/w
set Output.z = z/w
return Output
endfunction
struct MATRIX3
static MATRIX3 E
real m11
real m12
real m13
real m21
real m22
real m23
real m31
real m32
real m33
static method New_0 takes nothing returns MATRIX3
local MATRIX3 this = MATRIX3.create()
set .m11 = 0
set .m12 = 0
set .m13 = 0
set .m21 = 0
set .m22 = 0
set .m23 = 0
set .m31 = 0
set .m32 = 0
set .m33 = 0
return this
endmethod
static method New_1 takes real r11, real r12, real r13, real r21, real r22, real r23, real r31, real r32, real r33 returns MATRIX3
local MATRIX3 this = MATRIX3.create()
set .m11 = r11
set .m12 = r12
set .m13 = r13
set .m21 = r21
set .m22 = r22
set .m23 = r23
set .m31 = r31
set .m32 = r32
set .m33 = r33
return this
endmethod
static method New_2 takes MATRIX3 m returns MATRIX3
local MATRIX3 this = MATRIX3.create()
set .m11 = m.m11
set .m12 = m.m12
set .m13 = m.m13
set .m21 = m.m21
set .m22 = m.m22
set .m23 = m.m23
set .m31 = m.m31
set .m32 = m.m32
set .m33 = m.m33
return this
endmethod
static method SetMatrix takes MATRIX3 this, real r11, real r12, real r13, real r21, real r22, real r23, real r31, real r32, real r33 returns MATRIX3
set .m11 = r11
set .m12 = r12
set .m13 = r13
set .m21 = r21
set .m22 = r22
set .m23 = r23
set .m31 = r31
set .m32 = r32
set .m33 = r33
return this
endmethod
method ToString takes nothing returns string
return "Matrux3 id "+I2S(this)+"\n"+R2S(.m11)+" "+R2S(.m12)+" "+R2S(.m13)+"\n"+R2S(.m21)+" "+R2S(.m22)+" "+R2S(.m23)+"\n"+R2S(.m31)+" "+R2S(.m32)+" "+R2S(.m33)
endmethod
endstruct
function Matrix3Multiply takes MATRIX3 Output, MATRIX3 M1, MATRIX3 M2 returns MATRIX3
return MATRIX3.SetMatrix(Output,M1.m11*M2.m11+M1.m21*M2.m12+M1.m31*M2.m13,M1.m12*M2.m11+M1.m22*M2.m12+M1.m32*M2.m13,M1.m13*M2.m11+M1.m23*M2.m12+M1.m33*M2.m13,M1.m11*M2.m21+M1.m21*M2.m22+M1.m31*M2.m23,M1.m12*M2.m21+M1.m22*M2.m22+M1.m32*M2.m23,M1.m13*M2.m21+M1.m23*M2.m22+M1.m33*M2.m23,M1.m11*M2.m31+M1.m21*M2.m32+M1.m31*M2.m33,M1.m12*M2.m31+M1.m22*M2.m32+M1.m32*M2.m33,M1.m13*M2.m31+M1.m23*M2.m32+M1.m33*M2.m33)
endfunction
function Matrix3Scaling takes MATRIX3 Output, real x, real y, real z returns MATRIX3
return MATRIX3.SetMatrix(Output,x,0,0,0,y,0,0,0,z)
endfunction
function Matrix3ScalingInverse takes MATRIX3 Output, real x, real y, real z returns MATRIX3
return MATRIX3.SetMatrix(Output,1/x,0,0,0,1/y,0,0,0,1/z)
endfunction
function Matrix3RotationX takes MATRIX3 Output, real a returns MATRIX3
return MATRIX3.SetMatrix(Output,1,0,0,0,Cos(a),-Sin(a),0,Sin(a),Cos(a))
endfunction
function Matrix3RotationY takes MATRIX3 Output, real a returns MATRIX3
return MATRIX3.SetMatrix(Output,Cos(a),0,Sin(a),0,1,0,-Sin(a),0,Cos(a))
endfunction
function Matrix3RotationZ takes MATRIX3 Output, real a returns MATRIX3
return MATRIX3.SetMatrix(Output,Cos(a),-Sin(a),0,Sin(a),Cos(a),0,0,0,1)
endfunction
function Matrix3RotationAxis takes MATRIX3 Output, VECTOR3 v, real a returns MATRIX3
local real cosa = Cos(a)
local real sina = Sin(a)
return MATRIX3.SetMatrix(Output,cosa+(1-cosa)*v.x*v.x,(1-cosa)*v.x*v.y-sina*v.z,(1-cosa)*v.x*v.z+sina*v.y,(1-cosa)*v.y*v.x+sina*v.z,cosa+(1-cosa)*v.y*v.y,(1-cosa)*v.y*v.z-sina*v.x,(1-cosa)*v.z*v.x-sina*v.y,(1-cosa)*v.z*v.y+sina*v.x,cosa+(1-cosa)*v.z*v.z)
endfunction
function Matrix3RotationYawPitchRoll takes MATRIX3 Output, real Yaw, real Pitch, real Roll returns MATRIX3
local real cosa = Cos(Yaw)
local real sina = Sin(Yaw)
local real cosb = Cos(Pitch)
local real sinb = Sin(Pitch)
local real cosy = Cos(Roll)
local real siny = Sin(Roll)
return MATRIX3.SetMatrix(Output,cosa*cosb,cosa*sinb*siny-sina*cosy,cosa*sinb*cosy+sina*siny,sina*cosb,sina*sinb*siny+cosa*cosy,sina*sinb*cosy-cosa*siny,-sinb,cosb*siny,cosb*cosy)
endfunction
struct MATRIX4
static MATRIX4 E
real m11
real m12
real m13
real m14
real m21
real m22
real m23
real m24
real m31
real m32
real m33
real m34
real m41
real m42
real m43
real m44
static method New_0 takes nothing returns MATRIX4
local MATRIX4 this = MATRIX4.create()
set .m11 = 0
set .m12 = 0
set .m13 = 0
set .m14 = 0
set .m21 = 0
set .m22 = 0
set .m23 = 0
set .m24 = 0
set .m31 = 0
set .m32 = 0
set .m33 = 0
set .m34 = 0
set .m41 = 0
set .m42 = 0
set .m43 = 0
set .m44 = 0
return this
endmethod
static method New_1 takes real r11, real r12, real r13, real r14, real r21, real r22, real r23, real r24, real r31, real r32, real r33, real r34, real r41, real r42, real r43, real r44 returns MATRIX4
local MATRIX4 this = MATRIX4.create()
set .m11 = r11
set .m12 = r12
set .m13 = r13
set .m14 = r14
set .m21 = r21
set .m22 = r22
set .m23 = r23
set .m24 = r24
set .m31 = r31
set .m32 = r32
set .m33 = r33
set .m34 = r34
set .m41 = r41
set .m42 = r42
set .m43 = r43
set .m44 = r44
return this
endmethod
static method New_2 takes MATRIX4 m returns MATRIX4
local MATRIX4 this = MATRIX4.create()
set .m11 = m.m11
set .m12 = m.m12
set .m13 = m.m13
set .m14 = m.m14
set .m21 = m.m21
set .m22 = m.m22
set .m23 = m.m23
set .m24 = m.m24
set .m31 = m.m31
set .m32 = m.m32
set .m33 = m.m33
set .m34 = m.m34
set .m41 = m.m41
set .m42 = m.m42
set .m43 = m.m43
set .m44 = m.m44
return this
endmethod
static method New_3 takes MATRIX3 m returns MATRIX4
local MATRIX4 this = MATRIX4.create()
set .m11 = m.m11
set .m12 = m.m12
set .m13 = m.m13
set .m14 = 0
set .m21 = m.m21
set .m22 = m.m22
set .m23 = m.m23
set .m24 = 0
set .m31 = m.m31
set .m32 = m.m32
set .m33 = m.m33
set .m34 = 0
set .m41 = 0
set .m42 = 0
set .m43 = 0
set .m44 = 1
return this
endmethod
static method SetMatrix takes MATRIX4 this, real r11, real r12, real r13, real r14, real r21, real r22, real r23, real r24, real r31, real r32, real r33, real r34, real r41, real r42, real r43, real r44 returns MATRIX4
set .m11 = r11
set .m12 = r12
set .m13 = r13
set .m14 = r14
set .m21 = r21
set .m22 = r22
set .m23 = r23
set .m24 = r24
set .m31 = r31
set .m32 = r32
set .m33 = r33
set .m34 = r34
set .m41 = r41
set .m42 = r42
set .m43 = r43
set .m44 = r44
return this
endmethod
method ToString takes nothing returns string
return "Matrux4 id "+I2S(this)+"\n"+R2S(.m11)+" "+R2S(.m12)+" "+R2S(.m13)+" "+R2S(.m14)+"\n"+R2S(.m21)+" "+R2S(.m22)+" "+R2S(.m23)+" "+R2S(.m24)+"\n"+R2S(.m31)+" "+R2S(.m32)+" "+R2S(.m33)+" "+R2S(.m34)+"\n"+R2S(.m41)+" "+R2S(.m42)+" "+R2S(.m43)+" "+R2S(.m44)
endmethod
endstruct
function Matrix4Multiply takes MATRIX4 Output, MATRIX4 M1, MATRIX4 M2 returns MATRIX4
return MATRIX4.SetMatrix(Output,M1.m11*M2.m11+M1.m21*M2.m12+M1.m31*M2.m13+M1.m41*M2.m14,M1.m12*M2.m11+M1.m22*M2.m12+M1.m32*M2.m13+M1.m42*M2.m14,M1.m13*M2.m11+M1.m23*M2.m12+M1.m33*M2.m13+M1.m43*M2.m14,M1.m14*M2.m11+M1.m24*M2.m12+M1.m34*M2.m13+M1.m44*M2.m14,M1.m11*M2.m21+M1.m21*M2.m22+M1.m31*M2.m23+M1.m41*M2.m24,M1.m12*M2.m21+M1.m22*M2.m22+M1.m32*M2.m23+M1.m42*M2.m24,M1.m13*M2.m21+M1.m23*M2.m22+M1.m33*M2.m23+M1.m43*M2.m24,M1.m14*M2.m21+M1.m24*M2.m22+M1.m34*M2.m23+M1.m44*M2.m24,M1.m11*M2.m31+M1.m21*M2.m32+M1.m31*M2.m33+M1.m41*M2.m34,M1.m12*M2.m31+M1.m22*M2.m32+M1.m32*M2.m33+M1.m42*M2.m34,M1.m13*M2.m31+M1.m23*M2.m32+M1.m33*M2.m33+M1.m43*M2.m34,M1.m14*M2.m31+M1.m24*M2.m32+M1.m34*M2.m33+M1.m44*M2.m34,M1.m11*M2.m41+M1.m21*M2.m42+M1.m31*M2.m43+M1.m41*M2.m44,M1.m12*M2.m41+M1.m22*M2.m42+M1.m32*M2.m43+M1.m42*M2.m44,M1.m13*M2.m41+M1.m23*M2.m42+M1.m33*M2.m43+M1.m43*M2.m44,M1.m14*M2.m41+M1.m24*M2.m42+M1.m34*M2.m43+M1.m44*M2.m44)
endfunction
private function Init takes nothing returns nothing
set VECTOR3.Zero = VECTOR3.New_0()
set VECTOR3.oneX = VECTOR3.New_1(1,0,0)
set VECTOR3.oneY = VECTOR3.New_1(0,1,0)
set VECTOR3.oneZ = VECTOR3.New_1(0,0,1)
set MATRIX3.E = MATRIX3.New_1(1,0,0,0,1,0,0,0,1)
set MATRIX4.E = MATRIX4.New_1(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
endfunction
endlibrary
function InitTrig_MATH takes nothing returns nothing
endfunction
//TESH.scrollpos=54
//TESH.alwaysfold=0
/* This library is used to create objects which can be used as models for this system
the library includes methods to input model verteces and edges, to create model objects
Methods:
method inputVerteces
--used to input vertece data for a modelInfo object
method inputEdges
--used to input edge dat for a modelInfo object
Note: modelInfo objects must be created in the bellow function
*/
library ModelInfo initializer init
globals
//here you can declare your models
modelInfo sphere
modelInfo pyramid
modelInfo teapot
endglobals
struct modelInfo
Table verteceX
Table verteceY
Table verteceZ
integer vertexCount =0
integer edgeCount = 0
Table edgeData
method inputVerteces takes real x, real y, real z returns nothing
set verteceX.real[vertexCount] = x
set verteceY.real[vertexCount] = y
set verteceZ.real[vertexCount] = z
set vertexCount = vertexCount + 1
endmethod
method inputEges takes integer data returns nothing
set edgeData.integer[edgeCount] = data
set edgeCount = edgeCount + 1
endmethod
static method create takes nothing returns modelInfo
local thistype this = thistype.allocate()
set verteceX = Table.create()
set verteceY = Table.create()
set verteceZ = Table.create()
set edgeData = Table.create()
return this
endmethod
endstruct
function init takes nothing returns nothing
//use this function to create your objects' data
//i have included a sphere a pyramid and a teapot models
//create a sphere
if 1==1 then //used to minimize all the text
set sphere = modelInfo.create()
//assign the verteces
call sphere.inputVerteces ( -0.0354602, 0.284237, 26.3184 )
call sphere.inputVerteces ( -0.035461, 18.8941, 18.6099 )
call sphere.inputVerteces ( -13.1946, 13.4434, 18.6099 )
call sphere.inputVerteces ( -18.6453, 0.284235, 18.6099 )
call sphere.inputVerteces ( -13.1946, -12.8749, 18.6099 )
call sphere.inputVerteces ( -0.0354577, -18.3256, 18.6099 )
call sphere.inputVerteces ( 13.1237, -12.8749, 18.6099 )
call sphere.inputVerteces ( 18.5744, 0.28424, 18.6099 )
call sphere.inputVerteces ( 13.1237, 13.4434, 18.6099 )
call sphere.inputVerteces ( -0.0354613, 26.6026, -0.0000011504 )
call sphere.inputVerteces ( -18.6453, 18.8941, -0.0000011504 )
call sphere.inputVerteces ( -26.3538, 0.284234, -0.0000011504 )
call sphere.inputVerteces ( -18.6453, -18.3256, -0.0000011504 )
call sphere.inputVerteces ( -0.0354567, -26.0341, -0.0000011504 )
call sphere.inputVerteces ( 18.5744, -18.3256, -0.0000011504 )
call sphere.inputVerteces ( 26.2829, 0.284241, -0.0000011504 )
call sphere.inputVerteces ( 18.5744, 18.8941, -0.0000011504 )
call sphere.inputVerteces ( -0.035461, 18.8941, -18.6099 )
call sphere.inputVerteces ( -13.1946, 13.4434, -18.6099 )
call sphere.inputVerteces ( -18.6453, 0.284235, -18.6099 )
call sphere.inputVerteces ( -13.1946, -12.8749, -18.6099 )
call sphere.inputVerteces ( -0.0354577, -18.3256, -18.6099 )
call sphere.inputVerteces ( 13.1237, -12.8749, -18.6099 )
call sphere.inputVerteces ( 18.5744, 0.28424, -18.6099 )
call sphere.inputVerteces ( 13.1237, 13.4434, -18.6099 )
call sphere.inputVerteces ( -0.0354602, 0.284237, -26.3184 )
//assign the edge data
call sphere.inputEges(0)
call sphere.inputEges(1)
call sphere.inputEges(1)
call sphere.inputEges(2)
call sphere.inputEges(0)
call sphere.inputEges(2)
call sphere.inputEges(3)
call sphere.inputEges(0)
call sphere.inputEges(3)
call sphere.inputEges(4)
call sphere.inputEges(0)
call sphere.inputEges(4)
call sphere.inputEges(5)
call sphere.inputEges(0)
call sphere.inputEges(5)
call sphere.inputEges(6)
call sphere.inputEges(0)
call sphere.inputEges(6)
call sphere.inputEges(7)
call sphere.inputEges(0)
call sphere.inputEges(7)
call sphere.inputEges(8)
call sphere.inputEges(0)
call sphere.inputEges(8)
call sphere.inputEges(1)
call sphere.inputEges(1)
call sphere.inputEges(9)
call sphere.inputEges(10)
call sphere.inputEges(1)
call sphere.inputEges(10)
call sphere.inputEges(2)
call sphere.inputEges(2)
call sphere.inputEges(10)
call sphere.inputEges(11)
call sphere.inputEges(2)
call sphere.inputEges(11)
call sphere.inputEges(3)
call sphere.inputEges(3)
call sphere.inputEges(11)
call sphere.inputEges(12)
call sphere.inputEges(3)
call sphere.inputEges(12)
call sphere.inputEges(4)
call sphere.inputEges(4)
call sphere.inputEges(12)
call sphere.inputEges(13)
call sphere.inputEges(4)
call sphere.inputEges(13)
call sphere.inputEges(5)
call sphere.inputEges(5)
call sphere.inputEges(13)
call sphere.inputEges(14)
call sphere.inputEges(5)
call sphere.inputEges(14)
call sphere.inputEges(6)
call sphere.inputEges(6)
call sphere.inputEges(14)
call sphere.inputEges(15)
call sphere.inputEges(6)
call sphere.inputEges(15)
call sphere.inputEges(7)
call sphere.inputEges(7)
call sphere.inputEges(15)
call sphere.inputEges(16)
call sphere.inputEges(7)
call sphere.inputEges(16)
call sphere.inputEges(8)
call sphere.inputEges(8)
call sphere.inputEges(16)
call sphere.inputEges(9)
call sphere.inputEges(8)
call sphere.inputEges(9)
call sphere.inputEges(1)
call sphere.inputEges(9)
call sphere.inputEges(17)
call sphere.inputEges(18)
call sphere.inputEges(9)
call sphere.inputEges(18)
call sphere.inputEges(10)
call sphere.inputEges(10)
call sphere.inputEges(18)
call sphere.inputEges(19)
call sphere.inputEges(10)
call sphere.inputEges(19)
call sphere.inputEges(11)
call sphere.inputEges(11)
call sphere.inputEges(19)
call sphere.inputEges(20)
call sphere.inputEges(11)
call sphere.inputEges(20)
call sphere.inputEges(12)
call sphere.inputEges(12)
call sphere.inputEges(20)
call sphere.inputEges(21)
call sphere.inputEges(12)
call sphere.inputEges(21)
call sphere.inputEges(13)
call sphere.inputEges(13)
call sphere.inputEges(21)
call sphere.inputEges(22)
call sphere.inputEges(13)
call sphere.inputEges(22)
call sphere.inputEges(14)
call sphere.inputEges(14)
call sphere.inputEges(22)
call sphere.inputEges(23)
call sphere.inputEges(14)
call sphere.inputEges(23)
call sphere.inputEges(15)
call sphere.inputEges(15)
call sphere.inputEges(23)
call sphere.inputEges(24)
call sphere.inputEges(15)
call sphere.inputEges(24)
call sphere.inputEges(16)
call sphere.inputEges(16)
call sphere.inputEges(24)
call sphere.inputEges(17)
call sphere.inputEges(16)
call sphere.inputEges(17)
call sphere.inputEges(9)
call sphere.inputEges(25)
call sphere.inputEges(18)
call sphere.inputEges(17)
call sphere.inputEges(25)
call sphere.inputEges(19)
call sphere.inputEges(18)
call sphere.inputEges(25)
call sphere.inputEges(20)
call sphere.inputEges(19)
call sphere.inputEges(25)
call sphere.inputEges(21)
call sphere.inputEges(20)
call sphere.inputEges(25)
call sphere.inputEges(22)
call sphere.inputEges(21)
call sphere.inputEges(25)
call sphere.inputEges(23)
call sphere.inputEges(22)
call sphere.inputEges(25)
call sphere.inputEges(24)
call sphere.inputEges(23)
call sphere.inputEges(25)
call sphere.inputEges(17)
call sphere.inputEges(24 )
endif
//TEAPOT
if 1==1 then //used to minimize all the test
set teapot= modelInfo.create()
call teapot.inputVerteces ( -76.8802, -43.322, 0.762388 )
call teapot.inputVerteces ( -80.0335, -43.4221, 0.762388 )
call teapot.inputVerteces ( -76.8802, -46.5254, 0.762387 )
call teapot.inputVerteces ( -76.8802, -30.3165, -31.0788 )
call teapot.inputVerteces ( -80.0335, -30.3875, -31.1499 )
call teapot.inputVerteces ( -76.8802, -32.5908, -33.3532 )
call teapot.inputVerteces ( -76.8802, 1.52478, -44.0844 )
call teapot.inputVerteces ( -80.0335, 1.52478, -44.1845 )
call teapot.inputVerteces ( -76.8802, 1.52478, -47.2878 )
call teapot.inputVerteces ( -76.8802, 34.4471, -31.0788 )
call teapot.inputVerteces ( -80.0335, 33.5722, -31.1499 )
call teapot.inputVerteces ( -76.8802, 35.6404, -33.3532 )
call teapot.inputVerteces ( -76.8802, 46.3716, 0.76239 )
call teapot.inputVerteces ( -80.0335, 46.4717, 0.76239 )
call teapot.inputVerteces ( -76.8802, 49.5749, 0.76239 )
call teapot.inputVerteces ( -76.8802, 33.366, 32.6036 )
call teapot.inputVerteces ( -80.0335, 33.4371, 32.6747 )
call teapot.inputVerteces ( -76.8802, 35.6404, 34.878 )
call teapot.inputVerteces ( -76.8802, 1.52478, 45.6092 )
call teapot.inputVerteces ( -80.0335, 1.52478, 45.7093 )
call teapot.inputVerteces ( -76.8802, 1.52478, 48.8125 )
call teapot.inputVerteces ( -76.8802, -30.3165, 32.6036 )
call teapot.inputVerteces ( -80.0335, -30.3875, 32.6747 )
call teapot.inputVerteces ( -76.8802, -32.5908, 34.878 )
call teapot.inputVerteces ( -51.9542, -57.5369, 0.762387 )
call teapot.inputVerteces ( -28.8301, -62.5421, 0.762387 )
call teapot.inputVerteces ( -51.9542, -40.409, -41.1714 )
call teapot.inputVerteces ( -28.8301, -43.9627, -44.7251 )
call teapot.inputVerteces ( -51.9542, 1.52478, -58.2993 )
call teapot.inputVerteces ( -28.8301, 1.52478, -63.3045 )
call teapot.inputVerteces ( -51.9542, 43.4585, -41.1714 )
call teapot.inputVerteces ( -28.8301, 47.0123, -44.7251 )
call teapot.inputVerteces ( -51.9542, 60.5864, 0.762391 )
call teapot.inputVerteces ( -28.8301, 65.5917, 0.762391 )
call teapot.inputVerteces ( -51.9542, 43.4585, 42.6962 )
call teapot.inputVerteces ( -28.8301, 47.0123, 46.2499 )
call teapot.inputVerteces ( -51.9542, 1.52478, 59.824 )
call teapot.inputVerteces ( -28.8301, 1.52478, 64.8293 )
call teapot.inputVerteces ( -51.9542, -40.409, 42.6962 )
call teapot.inputVerteces ( -28.8301, -43.9627, 46.2499 )
call teapot.inputVerteces ( -12.3129, -54.5337, 0.762387 )
call teapot.inputVerteces ( -4.80502, -46.5254, 0.762387 )
call teapot.inputVerteces ( -12.3128, -38.2768, -39.0392 )
call teapot.inputVerteces ( -4.80501, -32.5908, -33.3532 )
call teapot.inputVerteces ( -12.3128, 1.52478, -55.2961 )
call teapot.inputVerteces ( -4.80501, 1.52478, -47.2878 )
call teapot.inputVerteces ( -12.3128, 41.3263, -39.0392 )
call teapot.inputVerteces ( -4.80501, 35.6404, -33.3532 )
call teapot.inputVerteces ( -12.3129, 57.5833, 0.762391 )
call teapot.inputVerteces ( -4.80502, 49.5749, 0.76239 )
call teapot.inputVerteces ( -12.3129, 41.3263, 40.5639 )
call teapot.inputVerteces ( -4.80502, 35.6404, 34.878 )
call teapot.inputVerteces ( -12.3129, 1.52478, 56.8209 )
call teapot.inputVerteces ( -4.80502, 1.52478, 48.8125 )
call teapot.inputVerteces ( -12.3129, -38.2768, 40.5639 )
call teapot.inputVerteces ( -4.80502, -32.5908, 34.878 )
call teapot.inputVerteces ( -1.50157, -39.6182, 0.762388 )
call teapot.inputVerteces ( 0.0, 1.52478, 0.762389 )
call teapot.inputVerteces ( -1.50157, -27.6867, -28.4491 )
call teapot.inputVerteces ( -1.50157, 1.52478, -40.3806 )
call teapot.inputVerteces ( -1.50157, 30.7363, -28.4491 )
call teapot.inputVerteces ( -1.50157, 42.6677, 0.76239 )
call teapot.inputVerteces ( -1.50157, 30.7363, 29.9739 )
call teapot.inputVerteces ( -1.50157, 1.52478, 41.9053 )
call teapot.inputVerteces ( -1.50157, -27.6867, 29.9739 )
call teapot.inputVerteces ( -64.8677, 52.7783, 0.76239 )
call teapot.inputVerteces ( -63.9668, 78.8054, 0.762391 )
call teapot.inputVerteces ( -57.6602, 88.0151, 0.762391 )
call teapot.inputVerteces ( -68.4715, 51.1766, -6.44513 )
call teapot.inputVerteces ( -67.1201, 82.209, -6.44513 )
call teapot.inputVerteces ( -57.6602, 92.8201, -6.44513 )
call teapot.inputVerteces ( -72.0752, 49.5749, 0.76239 )
call teapot.inputVerteces ( -70.2733, 85.6125, 0.762391 )
call teapot.inputVerteces ( -57.6602, 97.6251, 0.762392 )
call teapot.inputVerteces ( -68.4715, 51.1766, 7.96991 )
call teapot.inputVerteces ( -67.1201, 82.209, 7.96991 )
call teapot.inputVerteces ( -57.6602, 92.8201, 7.96991 )
call teapot.inputVerteces ( -43.2451, 82.8096, 0.762391 )
call teapot.inputVerteces ( -28.8301, 65.5917, 0.762391 )
call teapot.inputVerteces ( -40.1669, 85.9129, -6.44513 )
call teapot.inputVerteces ( -24.0251, 63.99, -6.44513 )
call teapot.inputVerteces ( -37.0887, 89.0161, 0.762392 )
call teapot.inputVerteces ( -19.2201, 62.3883, 0.762391 )
call teapot.inputVerteces ( -40.1669, 85.9129, 7.96991 )
call teapot.inputVerteces ( -24.0251, 63.99, 7.96991 )
call teapot.inputVerteces ( -45.6476, -52.9321, 0.762387 )
call teapot.inputVerteces ( -57.6602, -74.955, 0.762387 )
call teapot.inputVerteces ( -76.8802, -84.9655, 0.762386 )
call teapot.inputVerteces ( -32.4339, -52.9321, -15.0942 )
call teapot.inputVerteces ( -51.9542, -79.7601, -10.169 )
call teapot.inputVerteces ( -76.8802, -94.5755, -5.24388 )
call teapot.inputVerteces ( -19.2201, -52.9321, 0.762387 )
call teapot.inputVerteces ( -46.2483, -84.5651, 0.762386 )
call teapot.inputVerteces ( -76.8802, -104.186, 0.762386 )
call teapot.inputVerteces ( -32.4339, -52.9321, 16.6189 )
call teapot.inputVerteces ( -51.9542, -79.7601, 11.6938 )
call teapot.inputVerteces ( -76.8802, -94.5755, 6.76866 )
call teapot.inputVerteces ( -78.6821, -88.9697, 0.762386 )
call teapot.inputVerteces ( -76.8802, -88.1688, 0.762386 )
call teapot.inputVerteces ( -79.02, -98.6298, -4.04263 )
call teapot.inputVerteces ( -76.8802, -94.5755, -2.84138 )
call teapot.inputVerteces ( -79.3578, -108.29, 0.762386 )
call teapot.inputVerteces ( -76.8802, -100.982, 0.762386 )
call teapot.inputVerteces ( -79.02, -98.6298, 5.5674 )
call teapot.inputVerteces ( -76.8802, -94.5755, 4.36615 )
call teapot.inputVerteces ( -100.905, 1.52478, 0.762389 )
call teapot.inputVerteces ( -95.4997, -8.88609, 0.762389 )
call teapot.inputVerteces ( -86.4903, -4.88191, 0.762389 )
call teapot.inputVerteces ( -95.4997, -5.87594, -6.63834 )
call teapot.inputVerteces ( -86.4903, -3.02397, -3.78636 )
call teapot.inputVerteces ( -95.4997, 1.52478, -9.64848 )
call teapot.inputVerteces ( -86.4903, 1.52478, -5.6443 )
call teapot.inputVerteces ( -95.4997, 8.92551, -6.63834 )
call teapot.inputVerteces ( -86.4903, 6.07353, -3.78636 )
call teapot.inputVerteces ( -95.4997, 11.9356, 0.762389 )
call teapot.inputVerteces ( -86.4903, 7.93147, 0.762389 )
call teapot.inputVerteces ( -95.4997, 8.92551, 8.16311 )
call teapot.inputVerteces ( -86.4903, 6.07353, 5.31114 )
call teapot.inputVerteces ( -95.4997, 1.52478, 11.1733 )
call teapot.inputVerteces ( -86.4903, 1.52478, 7.16908 )
call teapot.inputVerteces ( -95.4997, -5.87594, 8.16311 )
call teapot.inputVerteces ( -86.4903, -3.02397, 5.31114 )
call teapot.inputVerteces ( -81.6853, -24.9028, 0.762388 )
call teapot.inputVerteces ( -76.8802, -40.1187, 0.762388 )
call teapot.inputVerteces ( -81.6853, -17.2388, -18.0012 )
call teapot.inputVerteces ( -76.8802, -28.0421, -28.8045 )
call teapot.inputVerteces ( -81.6853, 1.52478, -25.6652 )
call teapot.inputVerteces ( -76.8802, 1.52478, -40.8811 )
call teapot.inputVerteces ( -81.6853, 20.2884, -18.0012 )
call teapot.inputVerteces ( -76.8802, 31.0916, -28.8045 )
call teapot.inputVerteces ( -81.6853, 27.9524, 0.76239 )
call teapot.inputVerteces ( -76.8802, 43.1682, 0.76239 )
call teapot.inputVerteces ( -81.6853, 20.2884, 19.526 )
call teapot.inputVerteces ( -76.8802, 31.0916, 30.3293 )
call teapot.inputVerteces ( -81.6853, 1.52478, 27.19 )
call teapot.inputVerteces ( -76.8802, 1.52478, 42.4059 )
call teapot.inputVerteces ( -81.6853, -17.2388, 19.526 )
call teapot.inputVerteces ( -76.8802, -28.0421, 30.3292 )
call teapot.inputEges(0 )
call teapot.inputEges( 3)
call teapot.inputEges( 4)
call teapot.inputEges( 4)
call teapot.inputEges( 1)
call teapot.inputEges( 0)
call teapot.inputEges( 1)
call teapot.inputEges( 4)
call teapot.inputEges( 5)
call teapot.inputEges( 5)
call teapot.inputEges( 2)
call teapot.inputEges( 1)
call teapot.inputEges( 3)
call teapot.inputEges( 6)
call teapot.inputEges( 7)
call teapot.inputEges( 7)
call teapot.inputEges( 4)
call teapot.inputEges( 3)
call teapot.inputEges( 4)
call teapot.inputEges( 7)
call teapot.inputEges( 8)
call teapot.inputEges( 8)
call teapot.inputEges( 5)
call teapot.inputEges( 4)
call teapot.inputEges( 6)
call teapot.inputEges( 9)
call teapot.inputEges( 10)
call teapot.inputEges( 10)
call teapot.inputEges( 7)
call teapot.inputEges( 6)
call teapot.inputEges( 7)
call teapot.inputEges( 10)
call teapot.inputEges( 11)
call teapot.inputEges( 11)
call teapot.inputEges( 8)
call teapot.inputEges( 7)
call teapot.inputEges( 9)
call teapot.inputEges( 12)
call teapot.inputEges( 13)
call teapot.inputEges( 13)
call teapot.inputEges( 10)
call teapot.inputEges( 9)
call teapot.inputEges( 10)
call teapot.inputEges( 13)
call teapot.inputEges( 14)
call teapot.inputEges( 14)
call teapot.inputEges( 11)
call teapot.inputEges( 10)
call teapot.inputEges( 12)
call teapot.inputEges( 15)
call teapot.inputEges( 16)
call teapot.inputEges( 16)
call teapot.inputEges( 13)
call teapot.inputEges( 12)
call teapot.inputEges( 13)
call teapot.inputEges( 16)
call teapot.inputEges( 17)
call teapot.inputEges( 17)
call teapot.inputEges( 14)
call teapot.inputEges( 13)
call teapot.inputEges( 15)
call teapot.inputEges( 18)
call teapot.inputEges( 19)
call teapot.inputEges( 19)
call teapot.inputEges( 16)
call teapot.inputEges( 15)
call teapot.inputEges( 16)
call teapot.inputEges( 19)
call teapot.inputEges( 20)
call teapot.inputEges( 20)
call teapot.inputEges( 17)
call teapot.inputEges( 16)
call teapot.inputEges( 18)
call teapot.inputEges( 21)
call teapot.inputEges( 22)
call teapot.inputEges( 22)
call teapot.inputEges( 19)
call teapot.inputEges( 18)
call teapot.inputEges( 19)
call teapot.inputEges( 22)
call teapot.inputEges( 23)
call teapot.inputEges( 23)
call teapot.inputEges( 20)
call teapot.inputEges( 19)
call teapot.inputEges( 21)
call teapot.inputEges( 0)
call teapot.inputEges( 1)
call teapot.inputEges( 1)
call teapot.inputEges( 22)
call teapot.inputEges( 21)
call teapot.inputEges( 22)
call teapot.inputEges( 1)
call teapot.inputEges( 2)
call teapot.inputEges( 2)
call teapot.inputEges( 23)
call teapot.inputEges( 22)
call teapot.inputEges( 2)
call teapot.inputEges( 5)
call teapot.inputEges( 26)
call teapot.inputEges( 26)
call teapot.inputEges( 24)
call teapot.inputEges( 2)
call teapot.inputEges( 24)
call teapot.inputEges( 26)
call teapot.inputEges( 27)
call teapot.inputEges( 27)
call teapot.inputEges( 25)
call teapot.inputEges( 24)
call teapot.inputEges( 5)
call teapot.inputEges( 8)
call teapot.inputEges( 28)
call teapot.inputEges( 28)
call teapot.inputEges( 26)
call teapot.inputEges( 5)
call teapot.inputEges( 26)
call teapot.inputEges( 28)
call teapot.inputEges( 29)
call teapot.inputEges( 29)
call teapot.inputEges( 27)
call teapot.inputEges( 26)
call teapot.inputEges( 8)
call teapot.inputEges( 11)
call teapot.inputEges( 30)
call teapot.inputEges( 30)
call teapot.inputEges( 28)
call teapot.inputEges( 8)
call teapot.inputEges( 28)
call teapot.inputEges( 30)
call teapot.inputEges( 31)
call teapot.inputEges( 31)
call teapot.inputEges( 29)
call teapot.inputEges( 28)
call teapot.inputEges( 11)
call teapot.inputEges( 14)
call teapot.inputEges( 32)
call teapot.inputEges( 32)
call teapot.inputEges( 30)
call teapot.inputEges( 11)
call teapot.inputEges( 30)
call teapot.inputEges( 32)
call teapot.inputEges( 33)
call teapot.inputEges( 33)
call teapot.inputEges( 31)
call teapot.inputEges( 30)
call teapot.inputEges( 14)
call teapot.inputEges( 17)
call teapot.inputEges( 34)
call teapot.inputEges( 34)
call teapot.inputEges( 32)
call teapot.inputEges( 14)
call teapot.inputEges( 32)
call teapot.inputEges( 34)
call teapot.inputEges( 35)
call teapot.inputEges( 35)
call teapot.inputEges( 33)
call teapot.inputEges( 32)
call teapot.inputEges( 17)
call teapot.inputEges( 20)
call teapot.inputEges( 36)
call teapot.inputEges( 36)
call teapot.inputEges( 34)
call teapot.inputEges( 17)
call teapot.inputEges( 34)
call teapot.inputEges( 36)
call teapot.inputEges( 37)
call teapot.inputEges( 37)
call teapot.inputEges( 35)
call teapot.inputEges( 34)
call teapot.inputEges( 20)
call teapot.inputEges( 23)
call teapot.inputEges( 38)
call teapot.inputEges( 38)
call teapot.inputEges( 36)
call teapot.inputEges( 20)
call teapot.inputEges( 36)
call teapot.inputEges( 38)
call teapot.inputEges( 39)
call teapot.inputEges( 39)
call teapot.inputEges( 37)
call teapot.inputEges( 36)
call teapot.inputEges( 23)
call teapot.inputEges( 2)
call teapot.inputEges( 24)
call teapot.inputEges( 24)
call teapot.inputEges( 38)
call teapot.inputEges( 23)
call teapot.inputEges( 38)
call teapot.inputEges( 24)
call teapot.inputEges( 25)
call teapot.inputEges( 25)
call teapot.inputEges( 39)
call teapot.inputEges( 38)
call teapot.inputEges( 25)
call teapot.inputEges( 27)
call teapot.inputEges( 42)
call teapot.inputEges( 42)
call teapot.inputEges( 40)
call teapot.inputEges( 25)
call teapot.inputEges( 40)
call teapot.inputEges( 42)
call teapot.inputEges( 43)
call teapot.inputEges( 43)
call teapot.inputEges( 41)
call teapot.inputEges( 40)
call teapot.inputEges( 27)
call teapot.inputEges( 29)
call teapot.inputEges( 44)
call teapot.inputEges( 44)
call teapot.inputEges( 42)
call teapot.inputEges( 27)
call teapot.inputEges( 42)
call teapot.inputEges( 44)
call teapot.inputEges( 45)
call teapot.inputEges( 45)
call teapot.inputEges( 43)
call teapot.inputEges( 42)
call teapot.inputEges( 29)
call teapot.inputEges( 31)
call teapot.inputEges( 46)
call teapot.inputEges( 46)
call teapot.inputEges( 44)
call teapot.inputEges( 29)
call teapot.inputEges( 44)
call teapot.inputEges( 46)
call teapot.inputEges( 47)
call teapot.inputEges( 47)
call teapot.inputEges( 45)
call teapot.inputEges( 44)
call teapot.inputEges( 31)
call teapot.inputEges( 33)
call teapot.inputEges( 48)
call teapot.inputEges( 48)
call teapot.inputEges( 46)
call teapot.inputEges( 31)
call teapot.inputEges( 46)
call teapot.inputEges( 48)
call teapot.inputEges( 49)
call teapot.inputEges( 49)
call teapot.inputEges( 47)
call teapot.inputEges( 46)
call teapot.inputEges( 33)
call teapot.inputEges( 35)
call teapot.inputEges( 50)
call teapot.inputEges( 50)
call teapot.inputEges( 48)
call teapot.inputEges( 33)
call teapot.inputEges( 48)
call teapot.inputEges( 50)
call teapot.inputEges( 51)
call teapot.inputEges( 51)
call teapot.inputEges( 49)
call teapot.inputEges( 48)
call teapot.inputEges( 35)
call teapot.inputEges( 37)
call teapot.inputEges( 52)
call teapot.inputEges( 52)
call teapot.inputEges( 50)
call teapot.inputEges( 35)
call teapot.inputEges( 50)
call teapot.inputEges( 52)
call teapot.inputEges( 53)
call teapot.inputEges( 53)
call teapot.inputEges( 51)
call teapot.inputEges( 50)
call teapot.inputEges( 37)
call teapot.inputEges( 39)
call teapot.inputEges( 54)
call teapot.inputEges( 54)
call teapot.inputEges( 52)
call teapot.inputEges( 37)
call teapot.inputEges( 52)
call teapot.inputEges( 54)
call teapot.inputEges( 55)
call teapot.inputEges( 55)
call teapot.inputEges( 53)
call teapot.inputEges( 52)
call teapot.inputEges( 39)
call teapot.inputEges( 25)
call teapot.inputEges( 40)
call teapot.inputEges( 40)
call teapot.inputEges( 54)
call teapot.inputEges( 39)
call teapot.inputEges( 54)
call teapot.inputEges( 40)
call teapot.inputEges( 41)
call teapot.inputEges( 41)
call teapot.inputEges( 55)
call teapot.inputEges( 54)
call teapot.inputEges( 41)
call teapot.inputEges( 43)
call teapot.inputEges( 58)
call teapot.inputEges( 58)
call teapot.inputEges( 56)
call teapot.inputEges( 41)
call teapot.inputEges( 56)
call teapot.inputEges( 58)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 56)
call teapot.inputEges( 43)
call teapot.inputEges( 45)
call teapot.inputEges( 59)
call teapot.inputEges( 59)
call teapot.inputEges( 58)
call teapot.inputEges( 43)
call teapot.inputEges( 58)
call teapot.inputEges( 59)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 58)
call teapot.inputEges( 45)
call teapot.inputEges( 47)
call teapot.inputEges( 60)
call teapot.inputEges( 60)
call teapot.inputEges( 59)
call teapot.inputEges( 45)
call teapot.inputEges( 59)
call teapot.inputEges( 60)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 59)
call teapot.inputEges( 47)
call teapot.inputEges( 49)
call teapot.inputEges( 61)
call teapot.inputEges( 61)
call teapot.inputEges( 60)
call teapot.inputEges( 47)
call teapot.inputEges( 60)
call teapot.inputEges( 61)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 60)
call teapot.inputEges( 49)
call teapot.inputEges( 51)
call teapot.inputEges( 62)
call teapot.inputEges( 62)
call teapot.inputEges( 61)
call teapot.inputEges( 49)
call teapot.inputEges( 61)
call teapot.inputEges( 62)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 61)
call teapot.inputEges( 51)
call teapot.inputEges( 53)
call teapot.inputEges( 63)
call teapot.inputEges( 63)
call teapot.inputEges( 62)
call teapot.inputEges( 51)
call teapot.inputEges( 62)
call teapot.inputEges( 63)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 62)
call teapot.inputEges( 53)
call teapot.inputEges( 55)
call teapot.inputEges( 64)
call teapot.inputEges( 64)
call teapot.inputEges( 63)
call teapot.inputEges( 53)
call teapot.inputEges( 63)
call teapot.inputEges( 64)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 63)
call teapot.inputEges( 55)
call teapot.inputEges( 41)
call teapot.inputEges( 56)
call teapot.inputEges( 56)
call teapot.inputEges( 64)
call teapot.inputEges( 55)
call teapot.inputEges( 64)
call teapot.inputEges( 56)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 57)
call teapot.inputEges( 64)
call teapot.inputEges( 65)
call teapot.inputEges( 68)
call teapot.inputEges( 69)
call teapot.inputEges( 69)
call teapot.inputEges( 66)
call teapot.inputEges( 65)
call teapot.inputEges( 66)
call teapot.inputEges( 69)
call teapot.inputEges( 70)
call teapot.inputEges( 70)
call teapot.inputEges( 67)
call teapot.inputEges( 66)
call teapot.inputEges( 68)
call teapot.inputEges( 71)
call teapot.inputEges( 72)
call teapot.inputEges( 72)
call teapot.inputEges( 69)
call teapot.inputEges( 68)
call teapot.inputEges( 69)
call teapot.inputEges( 72)
call teapot.inputEges( 73)
call teapot.inputEges( 73)
call teapot.inputEges( 70)
call teapot.inputEges( 69)
call teapot.inputEges( 71)
call teapot.inputEges( 74)
call teapot.inputEges( 75)
call teapot.inputEges( 75)
call teapot.inputEges( 72)
call teapot.inputEges( 71)
call teapot.inputEges( 72)
call teapot.inputEges( 75)
call teapot.inputEges( 76)
call teapot.inputEges( 76)
call teapot.inputEges( 73)
call teapot.inputEges( 72)
call teapot.inputEges( 74)
call teapot.inputEges( 65)
call teapot.inputEges( 66)
call teapot.inputEges( 66)
call teapot.inputEges( 75)
call teapot.inputEges( 74)
call teapot.inputEges( 75)
call teapot.inputEges( 66)
call teapot.inputEges( 67)
call teapot.inputEges( 67)
call teapot.inputEges( 76)
call teapot.inputEges( 75)
call teapot.inputEges( 67)
call teapot.inputEges( 70)
call teapot.inputEges( 79)
call teapot.inputEges( 79)
call teapot.inputEges( 77)
call teapot.inputEges( 67)
call teapot.inputEges( 77)
call teapot.inputEges( 79)
call teapot.inputEges( 80)
call teapot.inputEges( 80)
call teapot.inputEges( 78)
call teapot.inputEges( 77)
call teapot.inputEges( 70)
call teapot.inputEges( 73)
call teapot.inputEges( 81)
call teapot.inputEges( 81)
call teapot.inputEges( 79)
call teapot.inputEges( 70)
call teapot.inputEges( 79)
call teapot.inputEges( 81)
call teapot.inputEges( 82)
call teapot.inputEges( 82)
call teapot.inputEges( 80)
call teapot.inputEges( 79)
call teapot.inputEges( 73)
call teapot.inputEges( 76)
call teapot.inputEges( 83)
call teapot.inputEges( 83)
call teapot.inputEges( 81)
call teapot.inputEges( 73)
call teapot.inputEges( 81)
call teapot.inputEges( 83)
call teapot.inputEges( 84)
call teapot.inputEges( 84)
call teapot.inputEges( 82)
call teapot.inputEges( 81)
call teapot.inputEges( 76)
call teapot.inputEges( 67)
call teapot.inputEges( 77)
call teapot.inputEges( 77)
call teapot.inputEges( 83)
call teapot.inputEges( 76)
call teapot.inputEges( 83)
call teapot.inputEges( 77)
call teapot.inputEges( 78)
call teapot.inputEges( 78)
call teapot.inputEges( 84)
call teapot.inputEges( 83)
call teapot.inputEges( 85)
call teapot.inputEges( 88)
call teapot.inputEges( 89)
call teapot.inputEges( 89)
call teapot.inputEges( 86)
call teapot.inputEges( 85)
call teapot.inputEges( 86)
call teapot.inputEges( 89)
call teapot.inputEges( 90)
call teapot.inputEges( 90)
call teapot.inputEges( 87)
call teapot.inputEges( 86)
call teapot.inputEges( 88)
call teapot.inputEges( 91)
call teapot.inputEges( 92)
call teapot.inputEges( 92)
call teapot.inputEges( 89)
call teapot.inputEges( 88)
call teapot.inputEges( 89)
call teapot.inputEges( 92)
call teapot.inputEges( 93)
call teapot.inputEges( 93)
call teapot.inputEges( 90)
call teapot.inputEges( 89)
call teapot.inputEges( 91)
call teapot.inputEges( 94)
call teapot.inputEges( 95)
call teapot.inputEges( 95)
call teapot.inputEges( 92)
call teapot.inputEges( 91)
call teapot.inputEges( 92)
call teapot.inputEges( 95)
call teapot.inputEges( 96)
call teapot.inputEges( 96)
call teapot.inputEges( 93)
call teapot.inputEges( 92)
call teapot.inputEges( 94)
call teapot.inputEges( 85)
call teapot.inputEges( 86)
call teapot.inputEges( 86)
call teapot.inputEges( 95)
call teapot.inputEges( 94)
call teapot.inputEges( 95)
call teapot.inputEges( 86)
call teapot.inputEges( 87)
call teapot.inputEges( 87)
call teapot.inputEges( 96)
call teapot.inputEges( 95)
call teapot.inputEges( 87)
call teapot.inputEges( 90)
call teapot.inputEges( 99)
call teapot.inputEges( 99)
call teapot.inputEges( 97)
call teapot.inputEges( 87)
call teapot.inputEges( 97)
call teapot.inputEges( 99)
call teapot.inputEges( 100)
call teapot.inputEges( 100)
call teapot.inputEges( 98)
call teapot.inputEges( 97)
call teapot.inputEges( 90)
call teapot.inputEges( 93)
call teapot.inputEges( 101)
call teapot.inputEges( 101)
call teapot.inputEges( 99)
call teapot.inputEges( 90)
call teapot.inputEges( 99)
call teapot.inputEges( 101)
call teapot.inputEges( 102)
call teapot.inputEges( 102)
call teapot.inputEges( 100)
call teapot.inputEges( 99)
call teapot.inputEges( 93)
call teapot.inputEges( 96)
call teapot.inputEges( 103)
call teapot.inputEges( 103)
call teapot.inputEges( 101)
call teapot.inputEges( 93)
call teapot.inputEges( 101)
call teapot.inputEges( 103)
call teapot.inputEges( 104)
call teapot.inputEges( 104)
call teapot.inputEges( 102)
call teapot.inputEges( 101)
call teapot.inputEges( 96)
call teapot.inputEges( 87)
call teapot.inputEges( 97)
call teapot.inputEges( 97)
call teapot.inputEges( 103)
call teapot.inputEges( 96)
call teapot.inputEges( 103)
call teapot.inputEges( 97)
call teapot.inputEges( 98)
call teapot.inputEges( 98)
call teapot.inputEges( 104)
call teapot.inputEges( 103)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 108)
call teapot.inputEges( 108)
call teapot.inputEges( 106)
call teapot.inputEges( 105)
call teapot.inputEges( 106)
call teapot.inputEges( 108)
call teapot.inputEges( 109)
call teapot.inputEges( 109)
call teapot.inputEges( 107)
call teapot.inputEges( 106)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 110)
call teapot.inputEges( 110)
call teapot.inputEges( 108)
call teapot.inputEges( 105)
call teapot.inputEges( 108)
call teapot.inputEges( 110)
call teapot.inputEges( 111)
call teapot.inputEges( 111)
call teapot.inputEges( 109)
call teapot.inputEges( 108)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 112)
call teapot.inputEges( 112)
call teapot.inputEges( 110)
call teapot.inputEges( 105)
call teapot.inputEges( 110)
call teapot.inputEges( 112)
call teapot.inputEges( 113)
call teapot.inputEges( 113)
call teapot.inputEges( 111)
call teapot.inputEges( 110)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 114)
call teapot.inputEges( 114)
call teapot.inputEges( 112)
call teapot.inputEges( 105)
call teapot.inputEges( 112)
call teapot.inputEges( 114)
call teapot.inputEges( 115)
call teapot.inputEges( 115)
call teapot.inputEges( 113)
call teapot.inputEges( 112)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 116)
call teapot.inputEges( 116)
call teapot.inputEges( 114)
call teapot.inputEges( 105)
call teapot.inputEges( 114)
call teapot.inputEges( 116)
call teapot.inputEges( 117)
call teapot.inputEges( 117)
call teapot.inputEges( 115)
call teapot.inputEges( 114)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 118)
call teapot.inputEges( 118)
call teapot.inputEges( 116)
call teapot.inputEges( 105)
call teapot.inputEges( 116)
call teapot.inputEges( 118)
call teapot.inputEges( 119)
call teapot.inputEges( 119)
call teapot.inputEges( 117)
call teapot.inputEges( 116)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 120)
call teapot.inputEges( 120)
call teapot.inputEges( 118)
call teapot.inputEges( 105)
call teapot.inputEges( 118)
call teapot.inputEges( 120)
call teapot.inputEges( 121)
call teapot.inputEges( 121)
call teapot.inputEges( 119)
call teapot.inputEges( 118)
call teapot.inputEges( 105)
call teapot.inputEges( 105)
call teapot.inputEges( 106)
call teapot.inputEges( 106)
call teapot.inputEges( 120)
call teapot.inputEges( 105)
call teapot.inputEges( 120)
call teapot.inputEges( 106)
call teapot.inputEges( 107)
call teapot.inputEges( 107)
call teapot.inputEges( 121)
call teapot.inputEges( 120)
call teapot.inputEges( 107)
call teapot.inputEges( 109)
call teapot.inputEges( 124)
call teapot.inputEges( 124)
call teapot.inputEges( 122)
call teapot.inputEges( 107)
call teapot.inputEges( 122)
call teapot.inputEges( 124)
call teapot.inputEges( 125)
call teapot.inputEges( 125)
call teapot.inputEges( 123)
call teapot.inputEges( 122)
call teapot.inputEges( 109)
call teapot.inputEges( 111)
call teapot.inputEges( 126)
call teapot.inputEges( 126)
call teapot.inputEges( 124)
call teapot.inputEges( 109)
call teapot.inputEges( 124)
call teapot.inputEges( 126)
call teapot.inputEges( 127)
call teapot.inputEges( 127)
call teapot.inputEges( 125)
call teapot.inputEges( 124)
call teapot.inputEges( 111)
call teapot.inputEges( 113)
call teapot.inputEges( 128)
call teapot.inputEges( 128)
call teapot.inputEges( 126)
call teapot.inputEges( 111)
call teapot.inputEges( 126)
call teapot.inputEges( 128)
call teapot.inputEges( 129)
call teapot.inputEges( 129)
call teapot.inputEges( 127)
call teapot.inputEges( 126)
call teapot.inputEges( 113)
call teapot.inputEges( 115)
call teapot.inputEges( 130)
call teapot.inputEges( 130)
call teapot.inputEges( 128)
call teapot.inputEges( 113)
call teapot.inputEges( 128)
call teapot.inputEges( 130)
call teapot.inputEges( 131)
call teapot.inputEges( 131)
call teapot.inputEges( 129)
call teapot.inputEges( 128)
call teapot.inputEges( 115)
call teapot.inputEges( 117)
call teapot.inputEges( 132)
call teapot.inputEges( 132)
call teapot.inputEges( 130)
call teapot.inputEges( 115)
call teapot.inputEges( 130)
call teapot.inputEges( 132)
call teapot.inputEges( 133)
call teapot.inputEges( 133)
call teapot.inputEges( 131)
call teapot.inputEges( 130)
call teapot.inputEges( 117)
call teapot.inputEges( 119)
call teapot.inputEges( 134)
call teapot.inputEges( 134)
call teapot.inputEges( 132)
call teapot.inputEges( 117)
call teapot.inputEges( 132)
call teapot.inputEges( 134)
call teapot.inputEges( 135)
call teapot.inputEges( 135)
call teapot.inputEges( 133)
call teapot.inputEges( 132)
call teapot.inputEges( 119)
call teapot.inputEges( 121)
call teapot.inputEges( 136)
call teapot.inputEges( 136)
call teapot.inputEges( 134)
call teapot.inputEges( 119)
call teapot.inputEges( 134)
call teapot.inputEges( 136)
call teapot.inputEges( 137)
call teapot.inputEges( 137)
call teapot.inputEges( 135)
call teapot.inputEges( 134)
call teapot.inputEges( 121)
call teapot.inputEges( 107)
call teapot.inputEges( 122)
call teapot.inputEges( 122)
call teapot.inputEges( 136)
call teapot.inputEges( 121)
call teapot.inputEges( 136)
call teapot.inputEges( 122)
call teapot.inputEges( 123)
call teapot.inputEges( 123)
call teapot.inputEges( 137)
call teapot.inputEges(136 )
endif
//pyramid
if 1==1 then
set pyramid = modelInfo.create()
call pyramid.inputVerteces ( -46.3227, 31.8095, 0.0 )
call pyramid.inputVerteces ( 39.3603, 31.8095, 0.0 )
call pyramid.inputVerteces ( 36.4407, 53.9858, 0.0 )
call pyramid.inputVerteces ( 27.8809, 74.6509, 0.0 )
call pyramid.inputVerteces ( 14.2643, 92.3965, 0.0 )
call pyramid.inputVerteces ( -3.4812, 106.013, 0.0 )
call pyramid.inputVerteces ( -24.1463, 114.573, 0.0 )
call pyramid.inputVerteces ( -46.3227, 117.492, 0.0 )
call pyramid.inputVerteces ( -68.4991, 114.573, 0.0 )
call pyramid.inputVerteces ( -89.1642, 106.013, 0.0 )
call pyramid.inputVerteces ( -106.91, 92.3965, 0.0 )
call pyramid.inputVerteces ( -120.526, 74.6509, 0.0 )
call pyramid.inputVerteces ( -129.086, 53.9858, 0.0 )
call pyramid.inputVerteces ( -132.006, 31.8095, 0.0 )
call pyramid.inputVerteces ( -129.086, 9.63307, 0.0 )
call pyramid.inputVerteces ( -120.526, -11.032, 0.0 )
call pyramid.inputVerteces ( -106.91, -28.7775, 0.0 )
call pyramid.inputVerteces ( -89.1641, -42.3942, 0.0 )
call pyramid.inputVerteces ( -68.499, -50.9539, 0.0 )
call pyramid.inputVerteces ( -46.3227, -53.8735, 0.0 )
call pyramid.inputVerteces ( -24.1463, -50.9539, 0.0 )
call pyramid.inputVerteces ( -3.48119, -42.3941, 0.0 )
call pyramid.inputVerteces ( 14.2643, -28.7775, 0.0 )
call pyramid.inputVerteces ( 27.8809, -11.032, 0.0 )
call pyramid.inputVerteces ( 36.4407, 9.63309, 0.0 )
call pyramid.inputVerteces ( 22.2237, 31.8095, 25.4124 )
call pyramid.inputVerteces ( 19.888, 49.5506, 25.4124 )
call pyramid.inputVerteces ( 13.0402, 66.0826, 25.4124 )
call pyramid.inputVerteces ( 2.14692, 80.2791, 25.4124 )
call pyramid.inputVerteces ( -12.0495, 91.1723, 25.4124 )
call pyramid.inputVerteces ( -28.5816, 98.0202, 25.4124 )
call pyramid.inputVerteces ( -46.3227, 100.356, 25.4124 )
call pyramid.inputVerteces ( -64.0638, 98.0202, 25.4124 )
call pyramid.inputVerteces ( -80.5959, 91.1723, 25.4124 )
call pyramid.inputVerteces ( -94.7923, 80.2791, 25.4124 )
call pyramid.inputVerteces ( -105.686, 66.0826, 25.4124 )
call pyramid.inputVerteces ( -112.533, 49.5506, 25.4124 )
call pyramid.inputVerteces ( -114.869, 31.8095, 25.4124 )
call pyramid.inputVerteces ( -112.533, 14.0683, 25.4124 )
call pyramid.inputVerteces ( -105.686, -2.46373, 25.4124 )
call pyramid.inputVerteces ( -94.7923, -16.6601, 25.4124 )
call pyramid.inputVerteces ( -80.5958, -27.5534, 25.4124 )
call pyramid.inputVerteces ( -64.0638, -34.4012, 25.4124 )
call pyramid.inputVerteces ( -46.3227, -36.7369, 25.4124 )
call pyramid.inputVerteces ( -28.5816, -34.4012, 25.4124 )
call pyramid.inputVerteces ( -12.0495, -27.5534, 25.4124 )
call pyramid.inputVerteces ( 2.14693, -16.6601, 25.4124 )
call pyramid.inputVerteces ( 13.0402, -2.46371, 25.4124 )
call pyramid.inputVerteces ( 19.888, 14.0684, 25.4124 )
call pyramid.inputVerteces ( 5.0871, 31.8095, 50.8247 )
call pyramid.inputVerteces ( 3.33535, 45.1153, 50.8247 )
call pyramid.inputVerteces ( -1.80051, 57.5143, 50.8247 )
call pyramid.inputVerteces ( -9.97048, 68.1617, 50.8247 )
call pyramid.inputVerteces ( -20.6178, 76.3316, 50.8247 )
call pyramid.inputVerteces ( -33.0168, 81.4675, 50.8247 )
call pyramid.inputVerteces ( -46.3227, 83.2192, 50.8247 )
call pyramid.inputVerteces ( -59.6285, 81.4675, 50.8247 )
call pyramid.inputVerteces ( -72.0276, 76.3316, 50.8247 )
call pyramid.inputVerteces ( -82.6749, 68.1617, 50.8247 )
call pyramid.inputVerteces ( -90.8448, 57.5143, 50.8247 )
call pyramid.inputVerteces ( -95.9807, 45.1153, 50.8247 )
call pyramid.inputVerteces ( -97.7324, 31.8095, 50.8247 )
call pyramid.inputVerteces ( -95.9807, 18.5036, 50.8247 )
call pyramid.inputVerteces ( -90.8448, 6.10457, 50.8247 )
call pyramid.inputVerteces ( -82.6749, -4.54274, 50.8247 )
call pyramid.inputVerteces ( -72.0276, -12.7127, 50.8247 )
call pyramid.inputVerteces ( -59.6285, -17.8486, 50.8247 )
call pyramid.inputVerteces ( -46.3227, -19.6003, 50.8247 )
call pyramid.inputVerteces ( -33.0168, -17.8486, 50.8247 )
call pyramid.inputVerteces ( -20.6178, -12.7127, 50.8247 )
call pyramid.inputVerteces ( -9.97047, -4.54273, 50.8247 )
call pyramid.inputVerteces ( -1.8005, 6.10458, 50.8247 )
call pyramid.inputVerteces ( 3.33535, 18.5036, 50.8247 )
call pyramid.inputVerteces ( -12.0495, 31.8095, 76.2371 )
call pyramid.inputVerteces ( -13.2173, 40.68, 76.2371 )
call pyramid.inputVerteces ( -16.6412, 48.9461, 76.2371 )
call pyramid.inputVerteces ( -22.0879, 56.0443, 76.2371 )
call pyramid.inputVerteces ( -29.1861, 61.4909, 76.2371 )
call pyramid.inputVerteces ( -37.4521, 64.9148, 76.2371 )
call pyramid.inputVerteces ( -46.3227, 66.0826, 76.2371 )
call pyramid.inputVerteces ( -55.1932, 64.9148, 76.2371 )
call pyramid.inputVerteces ( -63.4593, 61.4909, 76.2371 )
call pyramid.inputVerteces ( -70.5575, 56.0443, 76.2371 )
call pyramid.inputVerteces ( -76.0041, 48.946, 76.2371 )
call pyramid.inputVerteces ( -79.428, 40.68, 76.2371 )
call pyramid.inputVerteces ( -80.5959, 31.8095, 76.2371 )
call pyramid.inputVerteces ( -79.428, 22.9389, 76.2371 )
call pyramid.inputVerteces ( -76.0041, 14.6729, 76.2371 )
call pyramid.inputVerteces ( -70.5575, 7.57466, 76.2371 )
call pyramid.inputVerteces ( -63.4593, 2.12801, 76.2371 )
call pyramid.inputVerteces ( -55.1932, -1.29589, 76.2371 )
call pyramid.inputVerteces ( -46.3227, -2.46372, 76.2371 )
call pyramid.inputVerteces ( -37.4521, -1.29589, 76.2371 )
call pyramid.inputVerteces ( -29.1861, 2.12802, 76.2371 )
call pyramid.inputVerteces ( -22.0879, 7.57466, 76.2371 )
call pyramid.inputVerteces ( -16.6412, 14.6729, 76.2371 )
call pyramid.inputVerteces ( -13.2173, 22.9389, 76.2371 )
call pyramid.inputVerteces ( -29.1861, 31.8095, 101.649 )
call pyramid.inputVerteces ( -29.77, 36.2447, 101.649 )
call pyramid.inputVerteces ( -31.482, 40.3778, 101.649 )
call pyramid.inputVerteces ( -34.2053, 43.9269, 101.649 )
call pyramid.inputVerteces ( -37.7544, 46.6502, 101.649 )
call pyramid.inputVerteces ( -41.8874, 48.3621, 101.649 )
call pyramid.inputVerteces ( -46.3227, 48.9461, 101.649 )
call pyramid.inputVerteces ( -50.7579, 48.3621, 101.649 )
call pyramid.inputVerteces ( -54.891, 46.6502, 101.649 )
call pyramid.inputVerteces ( -58.4401, 43.9269, 101.649 )
call pyramid.inputVerteces ( -61.1634, 40.3778, 101.649 )
call pyramid.inputVerteces ( -62.8754, 36.2447, 101.649 )
call pyramid.inputVerteces ( -63.4593, 31.8095, 101.649 )
call pyramid.inputVerteces ( -62.8754, 27.3742, 101.649 )
call pyramid.inputVerteces ( -61.1634, 23.2412, 101.649 )
call pyramid.inputVerteces ( -58.4401, 19.6921, 101.649 )
call pyramid.inputVerteces ( -54.891, 16.9687, 101.649 )
call pyramid.inputVerteces ( -50.7579, 15.2568, 101.649 )
call pyramid.inputVerteces ( -46.3227, 14.6729, 101.649 )
call pyramid.inputVerteces ( -41.8874, 15.2568, 101.649 )
call pyramid.inputVerteces ( -37.7544, 16.9687, 101.649 )
call pyramid.inputVerteces ( -34.2053, 19.6921, 101.649 )
call pyramid.inputVerteces ( -31.4819, 23.2412, 101.649 )
call pyramid.inputVerteces ( -29.77, 27.3742, 101.649 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputVerteces ( -46.3227, 31.8095, 127.062 )
call pyramid.inputEges( 0)
call pyramid.inputEges( 2)
call pyramid.inputEges( 1)
call pyramid.inputEges( 0)
call pyramid.inputEges( 3)
call pyramid.inputEges( 2)
call pyramid.inputEges( 0)
call pyramid.inputEges( 4)
call pyramid.inputEges( 3)
call pyramid.inputEges( 0)
call pyramid.inputEges( 5)
call pyramid.inputEges( 4)
call pyramid.inputEges( 0)
call pyramid.inputEges( 6)
call pyramid.inputEges( 5)
call pyramid.inputEges( 0)
call pyramid.inputEges( 7)
call pyramid.inputEges( 6)
call pyramid.inputEges( 0)
call pyramid.inputEges( 8)
call pyramid.inputEges( 7)
call pyramid.inputEges( 0)
call pyramid.inputEges( 9)
call pyramid.inputEges( 8)
call pyramid.inputEges( 0)
call pyramid.inputEges( 10)
call pyramid.inputEges( 9)
call pyramid.inputEges( 0)
call pyramid.inputEges( 11)
call pyramid.inputEges( 10)
call pyramid.inputEges( 0)
call pyramid.inputEges( 12)
call pyramid.inputEges( 11)
call pyramid.inputEges( 0)
call pyramid.inputEges( 13)
call pyramid.inputEges( 12)
call pyramid.inputEges( 0)
call pyramid.inputEges( 14)
call pyramid.inputEges( 13)
call pyramid.inputEges( 0)
call pyramid.inputEges( 15)
call pyramid.inputEges( 14)
call pyramid.inputEges( 0)
call pyramid.inputEges( 16)
call pyramid.inputEges( 15)
call pyramid.inputEges( 0)
call pyramid.inputEges( 17)
call pyramid.inputEges( 16)
call pyramid.inputEges( 0)
call pyramid.inputEges( 18)
call pyramid.inputEges( 17)
call pyramid.inputEges( 0)
call pyramid.inputEges( 19)
call pyramid.inputEges( 18)
call pyramid.inputEges( 0)
call pyramid.inputEges( 20)
call pyramid.inputEges( 19)
call pyramid.inputEges( 0)
call pyramid.inputEges( 21)
call pyramid.inputEges( 20)
call pyramid.inputEges( 0)
call pyramid.inputEges( 22)
call pyramid.inputEges( 21)
call pyramid.inputEges( 0)
call pyramid.inputEges( 23)
call pyramid.inputEges( 22)
call pyramid.inputEges( 0)
call pyramid.inputEges( 24)
call pyramid.inputEges( 23)
call pyramid.inputEges( 0)
call pyramid.inputEges( 1)
call pyramid.inputEges( 24)
call pyramid.inputEges( 1)
call pyramid.inputEges( 26)
call pyramid.inputEges( 25)
call pyramid.inputEges( 1)
call pyramid.inputEges( 2)
call pyramid.inputEges( 26)
call pyramid.inputEges( 2)
call pyramid.inputEges( 27)
call pyramid.inputEges( 26)
call pyramid.inputEges( 2)
call pyramid.inputEges( 3)
call pyramid.inputEges( 27)
call pyramid.inputEges( 3)
call pyramid.inputEges( 28)
call pyramid.inputEges( 27)
call pyramid.inputEges( 3)
call pyramid.inputEges( 4)
call pyramid.inputEges( 28)
call pyramid.inputEges( 4)
call pyramid.inputEges( 29)
call pyramid.inputEges( 28)
call pyramid.inputEges( 4)
call pyramid.inputEges( 5)
call pyramid.inputEges( 29)
call pyramid.inputEges( 5)
call pyramid.inputEges( 30)
call pyramid.inputEges( 29)
call pyramid.inputEges( 5)
call pyramid.inputEges( 6)
call pyramid.inputEges( 30)
call pyramid.inputEges( 6)
call pyramid.inputEges( 31)
call pyramid.inputEges( 30)
call pyramid.inputEges( 6)
call pyramid.inputEges( 7)
call pyramid.inputEges( 31)
call pyramid.inputEges( 7)
call pyramid.inputEges( 32)
call pyramid.inputEges( 31)
call pyramid.inputEges( 7)
call pyramid.inputEges( 8)
call pyramid.inputEges( 32)
call pyramid.inputEges( 8)
call pyramid.inputEges( 33)
call pyramid.inputEges( 32)
call pyramid.inputEges( 8)
call pyramid.inputEges( 9)
call pyramid.inputEges( 33)
call pyramid.inputEges( 9)
call pyramid.inputEges( 34)
call pyramid.inputEges( 33)
call pyramid.inputEges( 9)
call pyramid.inputEges( 10)
call pyramid.inputEges( 34)
call pyramid.inputEges( 10)
call pyramid.inputEges( 35)
call pyramid.inputEges( 34)
call pyramid.inputEges( 10)
call pyramid.inputEges( 11)
call pyramid.inputEges( 35)
call pyramid.inputEges( 11)
call pyramid.inputEges( 36)
call pyramid.inputEges( 35)
call pyramid.inputEges( 11)
call pyramid.inputEges( 12)
call pyramid.inputEges( 36)
call pyramid.inputEges( 12)
call pyramid.inputEges( 37)
call pyramid.inputEges( 36)
call pyramid.inputEges( 12)
call pyramid.inputEges( 13)
call pyramid.inputEges( 37)
call pyramid.inputEges( 13)
call pyramid.inputEges( 38)
call pyramid.inputEges( 37)
call pyramid.inputEges( 13)
call pyramid.inputEges( 14)
call pyramid.inputEges( 38)
call pyramid.inputEges( 14)
call pyramid.inputEges( 39)
call pyramid.inputEges( 38)
call pyramid.inputEges( 14)
call pyramid.inputEges( 15)
call pyramid.inputEges( 39)
call pyramid.inputEges( 15)
call pyramid.inputEges( 40)
call pyramid.inputEges( 39)
call pyramid.inputEges( 15)
call pyramid.inputEges( 16)
call pyramid.inputEges( 40)
call pyramid.inputEges( 16)
call pyramid.inputEges( 41)
call pyramid.inputEges( 40)
call pyramid.inputEges( 16)
call pyramid.inputEges( 17)
call pyramid.inputEges( 41)
call pyramid.inputEges( 17)
call pyramid.inputEges( 42)
call pyramid.inputEges( 41)
call pyramid.inputEges( 17)
call pyramid.inputEges( 18)
call pyramid.inputEges( 42)
call pyramid.inputEges( 18)
call pyramid.inputEges( 43)
call pyramid.inputEges( 42)
call pyramid.inputEges( 18)
call pyramid.inputEges( 19)
call pyramid.inputEges( 43)
call pyramid.inputEges( 19)
call pyramid.inputEges( 44)
call pyramid.inputEges( 43)
call pyramid.inputEges( 19)
call pyramid.inputEges( 20)
call pyramid.inputEges( 44)
call pyramid.inputEges( 20)
call pyramid.inputEges( 45)
call pyramid.inputEges( 44)
call pyramid.inputEges( 20)
call pyramid.inputEges( 21)
call pyramid.inputEges( 45)
call pyramid.inputEges( 21)
call pyramid.inputEges( 46)
call pyramid.inputEges( 45)
call pyramid.inputEges( 21)
call pyramid.inputEges( 22)
call pyramid.inputEges( 46)
call pyramid.inputEges( 22)
call pyramid.inputEges( 47)
call pyramid.inputEges( 46)
call pyramid.inputEges( 22)
call pyramid.inputEges( 23)
call pyramid.inputEges( 47)
call pyramid.inputEges( 23)
call pyramid.inputEges( 48)
call pyramid.inputEges( 47)
call pyramid.inputEges( 23)
call pyramid.inputEges( 24)
call pyramid.inputEges( 48)
call pyramid.inputEges( 24)
call pyramid.inputEges( 25)
call pyramid.inputEges( 48)
call pyramid.inputEges( 24)
call pyramid.inputEges( 1)
call pyramid.inputEges( 25)
call pyramid.inputEges( 25)
call pyramid.inputEges( 50)
call pyramid.inputEges( 49)
call pyramid.inputEges( 25)
call pyramid.inputEges( 26)
call pyramid.inputEges( 50)
call pyramid.inputEges( 26)
call pyramid.inputEges( 51)
call pyramid.inputEges( 50)
call pyramid.inputEges( 26)
call pyramid.inputEges( 27)
call pyramid.inputEges( 51)
call pyramid.inputEges( 27)
call pyramid.inputEges( 52)
call pyramid.inputEges( 51)
call pyramid.inputEges( 27)
call pyramid.inputEges( 28)
call pyramid.inputEges( 52)
call pyramid.inputEges( 28)
call pyramid.inputEges( 53)
call pyramid.inputEges( 52)
call pyramid.inputEges( 28)
call pyramid.inputEges( 29)
call pyramid.inputEges( 53)
call pyramid.inputEges( 29)
call pyramid.inputEges( 54)
call pyramid.inputEges( 53)
call pyramid.inputEges( 29)
call pyramid.inputEges( 30)
call pyramid.inputEges( 54)
call pyramid.inputEges( 30)
call pyramid.inputEges( 55)
call pyramid.inputEges( 54)
call pyramid.inputEges( 30)
call pyramid.inputEges( 31)
call pyramid.inputEges( 55)
call pyramid.inputEges( 31)
call pyramid.inputEges( 56)
call pyramid.inputEges( 55)
call pyramid.inputEges( 31)
call pyramid.inputEges( 32)
call pyramid.inputEges( 56)
call pyramid.inputEges( 32)
call pyramid.inputEges( 57)
call pyramid.inputEges( 56)
call pyramid.inputEges( 32)
call pyramid.inputEges( 33)
call pyramid.inputEges( 57)
call pyramid.inputEges( 33)
call pyramid.inputEges( 58)
call pyramid.inputEges( 57)
call pyramid.inputEges( 33)
call pyramid.inputEges( 34)
call pyramid.inputEges( 58)
call pyramid.inputEges( 34)
call pyramid.inputEges( 59)
call pyramid.inputEges( 58)
call pyramid.inputEges( 34)
call pyramid.inputEges( 35)
call pyramid.inputEges( 59)
call pyramid.inputEges( 35)
call pyramid.inputEges( 60)
call pyramid.inputEges( 59)
call pyramid.inputEges( 35)
call pyramid.inputEges( 36)
call pyramid.inputEges( 60)
call pyramid.inputEges( 36)
call pyramid.inputEges( 61)
call pyramid.inputEges( 60)
call pyramid.inputEges( 36)
call pyramid.inputEges( 37)
call pyramid.inputEges( 61)
call pyramid.inputEges( 37)
call pyramid.inputEges( 62)
call pyramid.inputEges( 61)
call pyramid.inputEges( 37)
call pyramid.inputEges( 38)
call pyramid.inputEges( 62)
call pyramid.inputEges( 38)
call pyramid.inputEges( 63)
call pyramid.inputEges( 62)
call pyramid.inputEges( 38)
call pyramid.inputEges( 39)
call pyramid.inputEges( 63)
call pyramid.inputEges( 39)
call pyramid.inputEges( 64)
call pyramid.inputEges( 63)
call pyramid.inputEges( 39)
call pyramid.inputEges( 40)
call pyramid.inputEges( 64)
call pyramid.inputEges( 40)
call pyramid.inputEges( 65)
call pyramid.inputEges( 64)
call pyramid.inputEges( 40)
call pyramid.inputEges( 41)
call pyramid.inputEges( 65)
call pyramid.inputEges( 41)
call pyramid.inputEges( 66)
call pyramid.inputEges( 65)
call pyramid.inputEges( 41)
call pyramid.inputEges( 42)
call pyramid.inputEges( 66)
call pyramid.inputEges( 42)
call pyramid.inputEges( 67)
call pyramid.inputEges( 66)
call pyramid.inputEges( 42)
call pyramid.inputEges( 43)
call pyramid.inputEges( 67)
call pyramid.inputEges( 43)
call pyramid.inputEges( 68)
call pyramid.inputEges( 67)
call pyramid.inputEges( 43)
call pyramid.inputEges( 44)
call pyramid.inputEges( 68)
call pyramid.inputEges( 44)
call pyramid.inputEges( 69)
call pyramid.inputEges( 68)
call pyramid.inputEges( 44)
call pyramid.inputEges( 45)
call pyramid.inputEges( 69)
call pyramid.inputEges( 45)
call pyramid.inputEges( 70)
call pyramid.inputEges( 69)
call pyramid.inputEges( 45)
call pyramid.inputEges( 46)
call pyramid.inputEges( 70)
call pyramid.inputEges( 46)
call pyramid.inputEges( 71)
call pyramid.inputEges( 70)
call pyramid.inputEges( 46)
call pyramid.inputEges( 47)
call pyramid.inputEges( 71)
call pyramid.inputEges( 47)
call pyramid.inputEges( 72)
call pyramid.inputEges( 71)
call pyramid.inputEges( 47)
call pyramid.inputEges( 48)
call pyramid.inputEges( 72)
call pyramid.inputEges( 48)
call pyramid.inputEges( 49)
call pyramid.inputEges( 72)
call pyramid.inputEges( 48)
call pyramid.inputEges( 25)
call pyramid.inputEges( 49)
call pyramid.inputEges( 49)
call pyramid.inputEges( 74)
call pyramid.inputEges( 73)
call pyramid.inputEges( 49)
call pyramid.inputEges( 50)
call pyramid.inputEges( 74)
call pyramid.inputEges( 50)
call pyramid.inputEges( 75)
call pyramid.inputEges( 74)
call pyramid.inputEges( 50)
call pyramid.inputEges( 51)
call pyramid.inputEges( 75)
call pyramid.inputEges( 51)
call pyramid.inputEges( 76)
call pyramid.inputEges( 75)
call pyramid.inputEges( 51)
call pyramid.inputEges( 52)
call pyramid.inputEges( 76)
call pyramid.inputEges( 52)
call pyramid.inputEges( 77)
call pyramid.inputEges( 76)
call pyramid.inputEges( 52)
call pyramid.inputEges( 53)
call pyramid.inputEges( 77)
call pyramid.inputEges( 53)
call pyramid.inputEges( 78)
call pyramid.inputEges( 77)
call pyramid.inputEges( 53)
call pyramid.inputEges( 54)
call pyramid.inputEges( 78)
call pyramid.inputEges( 54)
call pyramid.inputEges( 79)
call pyramid.inputEges( 78)
call pyramid.inputEges( 54)
call pyramid.inputEges( 55)
call pyramid.inputEges( 79)
call pyramid.inputEges( 55)
call pyramid.inputEges( 80)
call pyramid.inputEges( 79)
call pyramid.inputEges( 55)
call pyramid.inputEges( 56)
call pyramid.inputEges( 80)
call pyramid.inputEges( 56)
call pyramid.inputEges( 81)
call pyramid.inputEges( 80)
call pyramid.inputEges( 56)
call pyramid.inputEges( 57)
call pyramid.inputEges( 81)
call pyramid.inputEges( 57)
call pyramid.inputEges( 82)
call pyramid.inputEges( 81)
call pyramid.inputEges( 57)
call pyramid.inputEges( 58)
call pyramid.inputEges( 82)
call pyramid.inputEges( 58)
call pyramid.inputEges( 83)
call pyramid.inputEges( 82)
call pyramid.inputEges( 58)
call pyramid.inputEges( 59)
call pyramid.inputEges( 83)
call pyramid.inputEges( 59)
call pyramid.inputEges( 84)
call pyramid.inputEges( 83)
call pyramid.inputEges( 59)
call pyramid.inputEges( 60)
call pyramid.inputEges( 84)
call pyramid.inputEges( 60)
call pyramid.inputEges( 85)
call pyramid.inputEges( 84)
call pyramid.inputEges( 60)
call pyramid.inputEges( 61)
call pyramid.inputEges( 85)
call pyramid.inputEges( 61)
call pyramid.inputEges( 86)
call pyramid.inputEges( 85)
call pyramid.inputEges( 61)
call pyramid.inputEges( 62)
call pyramid.inputEges( 86)
call pyramid.inputEges( 62)
call pyramid.inputEges( 87)
call pyramid.inputEges( 86)
call pyramid.inputEges( 62)
call pyramid.inputEges( 63)
call pyramid.inputEges( 87)
call pyramid.inputEges( 63)
call pyramid.inputEges( 88)
call pyramid.inputEges( 87)
call pyramid.inputEges( 63)
call pyramid.inputEges( 64)
call pyramid.inputEges( 88)
call pyramid.inputEges( 64)
call pyramid.inputEges( 89)
call pyramid.inputEges( 88)
call pyramid.inputEges( 64)
call pyramid.inputEges( 65)
call pyramid.inputEges( 89)
call pyramid.inputEges( 65)
call pyramid.inputEges( 90)
call pyramid.inputEges( 89)
call pyramid.inputEges( 65)
call pyramid.inputEges( 66)
call pyramid.inputEges( 90)
call pyramid.inputEges( 66)
call pyramid.inputEges( 91)
call pyramid.inputEges( 90)
call pyramid.inputEges( 66)
call pyramid.inputEges( 67)
call pyramid.inputEges( 91)
call pyramid.inputEges( 67)
call pyramid.inputEges( 92)
call pyramid.inputEges( 91)
call pyramid.inputEges( 67)
call pyramid.inputEges( 68)
call pyramid.inputEges( 92)
call pyramid.inputEges( 68)
call pyramid.inputEges( 93)
call pyramid.inputEges( 92)
call pyramid.inputEges( 68)
call pyramid.inputEges( 69)
call pyramid.inputEges( 93)
call pyramid.inputEges( 69)
call pyramid.inputEges( 94)
call pyramid.inputEges( 93)
call pyramid.inputEges( 69)
call pyramid.inputEges( 70)
call pyramid.inputEges( 94)
call pyramid.inputEges( 70)
call pyramid.inputEges( 95)
call pyramid.inputEges( 94)
call pyramid.inputEges( 70)
call pyramid.inputEges( 71)
call pyramid.inputEges( 95)
call pyramid.inputEges( 71)
call pyramid.inputEges( 96)
call pyramid.inputEges( 95)
call pyramid.inputEges( 71)
call pyramid.inputEges( 72)
call pyramid.inputEges( 96)
call pyramid.inputEges( 72)
call pyramid.inputEges( 73)
call pyramid.inputEges( 96)
call pyramid.inputEges( 72)
call pyramid.inputEges( 49)
call pyramid.inputEges( 73)
call pyramid.inputEges( 73)
call pyramid.inputEges( 98)
call pyramid.inputEges( 97)
call pyramid.inputEges( 73)
call pyramid.inputEges( 74)
call pyramid.inputEges( 98)
call pyramid.inputEges( 74)
call pyramid.inputEges( 99)
call pyramid.inputEges( 98)
call pyramid.inputEges( 74)
call pyramid.inputEges( 75)
call pyramid.inputEges( 99)
call pyramid.inputEges( 75)
call pyramid.inputEges( 100)
call pyramid.inputEges( 99)
call pyramid.inputEges( 75)
call pyramid.inputEges( 76)
call pyramid.inputEges( 100)
call pyramid.inputEges( 76)
call pyramid.inputEges( 101)
call pyramid.inputEges( 100)
call pyramid.inputEges( 76)
call pyramid.inputEges( 77)
call pyramid.inputEges( 101)
call pyramid.inputEges( 77)
call pyramid.inputEges( 102)
call pyramid.inputEges( 101)
call pyramid.inputEges( 77)
call pyramid.inputEges( 78)
call pyramid.inputEges( 102)
call pyramid.inputEges( 78)
call pyramid.inputEges( 103)
call pyramid.inputEges( 102)
call pyramid.inputEges( 78)
call pyramid.inputEges( 79)
call pyramid.inputEges( 103)
call pyramid.inputEges( 79)
call pyramid.inputEges( 104)
call pyramid.inputEges( 103)
call pyramid.inputEges( 79)
call pyramid.inputEges( 80)
call pyramid.inputEges( 104)
call pyramid.inputEges( 80)
call pyramid.inputEges( 105)
call pyramid.inputEges( 104)
call pyramid.inputEges( 80)
call pyramid.inputEges( 81)
call pyramid.inputEges( 105)
call pyramid.inputEges( 81)
call pyramid.inputEges( 106)
call pyramid.inputEges( 105)
call pyramid.inputEges( 81)
call pyramid.inputEges( 82)
call pyramid.inputEges( 106)
call pyramid.inputEges( 82)
call pyramid.inputEges( 107)
call pyramid.inputEges( 106)
call pyramid.inputEges( 82)
call pyramid.inputEges( 83)
call pyramid.inputEges( 107)
call pyramid.inputEges( 83)
call pyramid.inputEges( 108)
call pyramid.inputEges( 107)
call pyramid.inputEges( 83)
call pyramid.inputEges( 84)
call pyramid.inputEges( 108)
call pyramid.inputEges( 84)
call pyramid.inputEges( 109)
call pyramid.inputEges( 108)
call pyramid.inputEges( 84)
call pyramid.inputEges( 85)
call pyramid.inputEges( 109)
call pyramid.inputEges( 85)
call pyramid.inputEges( 110)
call pyramid.inputEges( 109)
call pyramid.inputEges( 85)
call pyramid.inputEges( 86)
call pyramid.inputEges( 110)
call pyramid.inputEges( 86)
call pyramid.inputEges( 111)
call pyramid.inputEges( 110)
call pyramid.inputEges( 86)
call pyramid.inputEges( 87)
call pyramid.inputEges( 111)
call pyramid.inputEges( 87)
call pyramid.inputEges( 112)
call pyramid.inputEges( 111)
call pyramid.inputEges( 87)
call pyramid.inputEges( 88)
call pyramid.inputEges( 112)
call pyramid.inputEges( 88)
call pyramid.inputEges( 113)
call pyramid.inputEges( 112)
call pyramid.inputEges( 88)
call pyramid.inputEges( 89)
call pyramid.inputEges( 113)
call pyramid.inputEges( 89)
call pyramid.inputEges( 114)
call pyramid.inputEges( 113)
call pyramid.inputEges( 89)
call pyramid.inputEges( 90)
call pyramid.inputEges( 114)
call pyramid.inputEges( 90)
call pyramid.inputEges( 115)
call pyramid.inputEges( 114)
call pyramid.inputEges( 90)
call pyramid.inputEges( 91)
call pyramid.inputEges( 115)
call pyramid.inputEges( 91)
call pyramid.inputEges( 116)
call pyramid.inputEges( 115)
call pyramid.inputEges( 91)
call pyramid.inputEges( 92)
call pyramid.inputEges( 116)
call pyramid.inputEges( 92)
call pyramid.inputEges( 117)
call pyramid.inputEges( 116)
call pyramid.inputEges( 92)
call pyramid.inputEges( 93)
call pyramid.inputEges( 117)
call pyramid.inputEges( 93)
call pyramid.inputEges( 118)
call pyramid.inputEges( 117)
call pyramid.inputEges( 93)
call pyramid.inputEges( 94)
call pyramid.inputEges( 118)
call pyramid.inputEges( 94)
call pyramid.inputEges( 119)
call pyramid.inputEges( 118)
call pyramid.inputEges( 94)
call pyramid.inputEges( 95)
call pyramid.inputEges( 119)
call pyramid.inputEges( 95)
call pyramid.inputEges( 120)
call pyramid.inputEges( 119)
call pyramid.inputEges( 95)
call pyramid.inputEges( 96)
call pyramid.inputEges( 120)
call pyramid.inputEges( 96)
call pyramid.inputEges( 97)
call pyramid.inputEges( 120)
call pyramid.inputEges( 96)
call pyramid.inputEges( 73)
call pyramid.inputEges( 97)
call pyramid.inputEges( 97)
call pyramid.inputEges( 122)
call pyramid.inputEges( 121)
call pyramid.inputEges( 97)
call pyramid.inputEges( 98)
call pyramid.inputEges( 122)
call pyramid.inputEges( 98)
call pyramid.inputEges( 123)
call pyramid.inputEges( 122)
call pyramid.inputEges( 98)
call pyramid.inputEges( 99)
call pyramid.inputEges( 123)
call pyramid.inputEges( 99)
call pyramid.inputEges( 124)
call pyramid.inputEges( 123)
call pyramid.inputEges( 99)
call pyramid.inputEges( 100)
call pyramid.inputEges( 124)
call pyramid.inputEges( 100)
call pyramid.inputEges( 125)
call pyramid.inputEges( 124)
call pyramid.inputEges( 100)
call pyramid.inputEges( 101)
call pyramid.inputEges( 125)
call pyramid.inputEges( 101)
call pyramid.inputEges( 126)
call pyramid.inputEges( 125)
call pyramid.inputEges( 101)
call pyramid.inputEges( 102)
call pyramid.inputEges( 126)
call pyramid.inputEges( 102)
call pyramid.inputEges( 127)
call pyramid.inputEges( 126)
call pyramid.inputEges( 102)
call pyramid.inputEges( 103)
call pyramid.inputEges( 127)
call pyramid.inputEges( 103)
call pyramid.inputEges( 128)
call pyramid.inputEges( 127)
call pyramid.inputEges( 103)
call pyramid.inputEges( 104)
call pyramid.inputEges( 128)
call pyramid.inputEges( 104)
call pyramid.inputEges( 129)
call pyramid.inputEges( 128)
call pyramid.inputEges( 104)
call pyramid.inputEges( 105)
call pyramid.inputEges( 129)
call pyramid.inputEges( 105)
call pyramid.inputEges( 130)
call pyramid.inputEges( 129)
call pyramid.inputEges( 105)
call pyramid.inputEges( 106)
call pyramid.inputEges( 130)
call pyramid.inputEges( 106)
call pyramid.inputEges( 131)
call pyramid.inputEges( 130)
call pyramid.inputEges( 106)
call pyramid.inputEges( 107)
call pyramid.inputEges( 131)
call pyramid.inputEges( 107)
call pyramid.inputEges( 132)
call pyramid.inputEges( 131)
call pyramid.inputEges( 107)
call pyramid.inputEges( 108)
call pyramid.inputEges( 132)
call pyramid.inputEges( 108)
call pyramid.inputEges( 133)
call pyramid.inputEges( 132)
call pyramid.inputEges( 108)
call pyramid.inputEges( 109)
call pyramid.inputEges( 133)
call pyramid.inputEges( 109)
call pyramid.inputEges( 134)
call pyramid.inputEges( 133)
call pyramid.inputEges( 109)
call pyramid.inputEges( 110)
call pyramid.inputEges( 134)
call pyramid.inputEges( 110)
call pyramid.inputEges( 135)
call pyramid.inputEges( 134)
call pyramid.inputEges( 110)
call pyramid.inputEges( 111)
call pyramid.inputEges( 135)
call pyramid.inputEges( 111)
call pyramid.inputEges( 136)
call pyramid.inputEges( 135)
call pyramid.inputEges( 111)
call pyramid.inputEges( 112)
call pyramid.inputEges( 136)
call pyramid.inputEges( 112)
call pyramid.inputEges( 137)
call pyramid.inputEges( 136)
call pyramid.inputEges( 112)
call pyramid.inputEges( 113)
call pyramid.inputEges( 137)
call pyramid.inputEges( 113)
call pyramid.inputEges( 138)
call pyramid.inputEges( 137)
call pyramid.inputEges( 113)
call pyramid.inputEges( 114)
call pyramid.inputEges( 138)
call pyramid.inputEges( 114)
call pyramid.inputEges( 139)
call pyramid.inputEges( 138)
call pyramid.inputEges( 114)
call pyramid.inputEges( 115)
call pyramid.inputEges( 139)
call pyramid.inputEges( 115)
call pyramid.inputEges( 140)
call pyramid.inputEges( 139)
call pyramid.inputEges( 115)
call pyramid.inputEges( 116)
call pyramid.inputEges( 140)
call pyramid.inputEges( 116)
call pyramid.inputEges( 141)
call pyramid.inputEges( 140)
call pyramid.inputEges( 116)
call pyramid.inputEges( 117)
call pyramid.inputEges( 141)
call pyramid.inputEges( 117)
call pyramid.inputEges( 142)
call pyramid.inputEges( 141)
call pyramid.inputEges( 117)
call pyramid.inputEges( 118)
call pyramid.inputEges( 142)
call pyramid.inputEges( 118)
call pyramid.inputEges( 143)
call pyramid.inputEges( 142)
call pyramid.inputEges( 118)
call pyramid.inputEges( 119)
call pyramid.inputEges( 143)
call pyramid.inputEges( 119)
call pyramid.inputEges( 144)
call pyramid.inputEges( 143)
call pyramid.inputEges( 119)
call pyramid.inputEges( 120)
call pyramid.inputEges( 144)
call pyramid.inputEges( 120)
call pyramid.inputEges( 121)
call pyramid.inputEges( 144)
call pyramid.inputEges( 120)
call pyramid.inputEges( 97)
call pyramid.inputEges( 121)
call pyramid.inputEges( 145)
call pyramid.inputEges( 121)
call pyramid.inputEges( 122)
call pyramid.inputEges( 145)
call pyramid.inputEges( 122)
call pyramid.inputEges( 123)
call pyramid.inputEges( 145)
call pyramid.inputEges( 123)
call pyramid.inputEges( 124)
call pyramid.inputEges( 145)
call pyramid.inputEges( 124)
call pyramid.inputEges( 125)
call pyramid.inputEges( 145)
call pyramid.inputEges( 125)
call pyramid.inputEges( 126)
call pyramid.inputEges( 145)
call pyramid.inputEges( 126)
call pyramid.inputEges( 127)
call pyramid.inputEges( 145)
call pyramid.inputEges( 127)
call pyramid.inputEges( 128)
call pyramid.inputEges( 145)
call pyramid.inputEges( 128)
call pyramid.inputEges( 129)
call pyramid.inputEges( 145)
call pyramid.inputEges( 129)
call pyramid.inputEges( 130)
call pyramid.inputEges( 145)
call pyramid.inputEges( 130)
call pyramid.inputEges( 131)
call pyramid.inputEges( 145)
call pyramid.inputEges( 131)
call pyramid.inputEges( 132)
call pyramid.inputEges( 145)
call pyramid.inputEges( 132)
call pyramid.inputEges( 133)
call pyramid.inputEges( 145)
call pyramid.inputEges( 133)
call pyramid.inputEges( 134)
call pyramid.inputEges( 145)
call pyramid.inputEges( 134)
call pyramid.inputEges( 135)
call pyramid.inputEges( 145)
call pyramid.inputEges( 135)
call pyramid.inputEges( 136)
call pyramid.inputEges( 145)
call pyramid.inputEges( 136)
call pyramid.inputEges( 137)
call pyramid.inputEges( 145)
call pyramid.inputEges( 137)
call pyramid.inputEges( 138)
call pyramid.inputEges( 145)
call pyramid.inputEges( 138)
call pyramid.inputEges( 139)
call pyramid.inputEges( 145)
call pyramid.inputEges( 139)
call pyramid.inputEges( 140)
call pyramid.inputEges( 145)
call pyramid.inputEges( 140)
call pyramid.inputEges( 141)
call pyramid.inputEges( 145)
call pyramid.inputEges( 141)
call pyramid.inputEges( 142)
call pyramid.inputEges( 145)
call pyramid.inputEges( 142)
call pyramid.inputEges( 143)
call pyramid.inputEges( 145)
call pyramid.inputEges( 143)
call pyramid.inputEges( 144)
call pyramid.inputEges( 145)
call pyramid.inputEges( 144)
call pyramid.inputEges( 121 )
endif
endfunction
endlibrary
//and there you go only 2k lines :D
//TESH.scrollpos=159
//TESH.alwaysfold=0
library MODEL uses Math
/* uses: Math(included)
Table by Bribe 3.1
creating a new model:
go to the model information assigning struct and create a new global variable
go to the init function in that trigger and assign edge and vertex data accordingly
just look at the example
methods:
create takes (modelInfo type(look in model info struct), real scale, real objectX, real objectY, real objectZ)
create method creates a model with the scale at location x y and z also requires you to put in the number of edges
assignEdges() // puts object data in the struct only called once on creation
genVerteces() //connects all your object's verteces to make it visible called once on creation
//-----------------------------------------------------------
scale(x,y,z) //scales your model by a percentage smaller models require higher percentage scales (900%) etc..
move(x,y,z) //moves your model. THIS STRUCT ONLY ACCEPTS NEW COORDINATES IT DOES NOT ADD TO OLD ONES
rotatex(real angle) //rotate your object, this feature will be refined later
destroy() //destroy model and all of its stuff
*/
struct modelData
private Table xVerteces //these are the vertece positons in space as x y and z
private Table yVerteces
private Table zVerteces
readonly Table xVertecesOG //these are the vertece positons as readonly values
readonly Table yVertecesOG
readonly Table zVertecesOG
private Table edgeConnectionData //this array holds data for edge connections
private Table edgesVisual //lightning array which connects the verteces
private Quaternian newCoord //used for rotation of a 3d object
real modelX //hold data for the model's location (yes it can be moved)
real modelY
real modelZ
real scalex //the model's scale
real scaley
real scalez
integer vertexC = 0 //counts number of verteces
integer edgeCount = 0 //counts number of eges
static method create takes modelInfo info, real scl, real locx , real locy , real locz returns thistype
//create method
local thistype this = thistype.allocate()
set this.xVerteces = Table.create()
set this.yVerteces = Table.create()
set this.zVerteces = Table.create()
set this.xVertecesOG = Table.create()
set this.yVertecesOG = Table.create()
set this.zVertecesOG = Table.create()
set this.edgeConnectionData = Table.create()
set this.edgesVisual = Table.create()
set this.edgeCount = info.edgeCount
set this.vertexC = info.vertexCount
set this.modelX = locx
set this.modelY = locy
set this.modelZ = locz
set this.scalex = scl
set this.scaley = scl
set this.scalez = scl
set this.newCoord = Quaternian.create()
call this.assignVerteces(info)
call this.assignEdges(info)
call this.genVerteces()
return this
endmethod
method assignVerteces takes modelInfo info returns nothing
//used for creation only
local integer l = 0
local real x = 0
local real y = 0
local real z = 0
loop
exitwhen l > vertexC
set x = info.verteceX.real[l]
set y = info.verteceY.real[l]
set z = info.verteceZ.real[l]
set xVertecesOG.real[l] = x //these tables hold the original data for the verteces
set yVertecesOG.real[l] = y
set zVertecesOG.real[l] = z
set x = x *.scalex + .modelX //???
set y = y *.scaley + .modelY
set z = z *.scalez + .modelZ
set xVerteces.real[l]= x ///modifiable vertece data
set yVerteces.real[l]= y
set zVerteces.real[l]= z
set l = l + 1
endloop
endmethod
method assignEdges takes modelInfo info returns nothing
//edge count will be used here
local integer l = 0
loop
exitwhen l > .edgeCount
set .edgeConnectionData.integer[l] = info.edgeData.integer[l]
set l = l + 1
endloop
endmethod
method genVerteces takes nothing returns nothing
//method used only for creation
local integer l = 0
loop
exitwhen l > .edgeCount
set .edgesVisual.lightning[l] = AddLightningEx("DRAL", false , .xVerteces.real[edgeConnectionData.integer[l]] , .yVerteces.real[edgeConnectionData.integer[l]] , .zVerteces.real[edgeConnectionData.integer[l]] , .xVerteces.real[edgeConnectionData.integer[l+1]], .yVerteces.real[edgeConnectionData.integer[l+1]] ,.zVerteces.real[edgeConnectionData.integer[l+1]])
set l = l + 1
endloop
endmethod
method update takes nothing returns nothing
//call this method when you have changed some data on the model and want to update it
//method usually gets called automatically so no need to use it
local integer l = 0
loop
exitwhen l > .edgeCount
call MoveLightningEx(.edgesVisual.lightning[l] , false , .xVerteces.real[edgeConnectionData.integer[l]] , .yVerteces.real[edgeConnectionData.integer[l]] , .zVerteces.real[edgeConnectionData.integer[l]] , .xVerteces.real[edgeConnectionData.integer[l+1]], .yVerteces.real[edgeConnectionData.integer[l+1]] ,.zVerteces.real[edgeConnectionData.integer[l+1]])
set l = l + 1
endloop
set l = 0
endmethod
method scale takes real x , real y, real z returns nothing
//scales the object on either plane by a percentage value
//the scaling actually depends on your model's coords if u have a very small model u might need to set scale to 8(800%) or 9(900%) or even 100(100000%) just to be visible
local integer l = 0
loop
exitwhen l > .vertexC
set xVerteces.real[l]= xVerteces.real[l] * x
set yVerteces.real[l]= yVerteces.real[l] * y
set zVerteces.real[l]= zVerteces.real[l] * z
set l = l + 1
endloop
set scalex = x
set scaley = y
set scalez = z
call .update()
endmethod
method move takes real x, real y, real z returns nothing
//moves the object to the new coords, this method only accepts new coords it does not add to old ones
local integer l = 0
loop
exitwhen l > .vertexC
set .xVerteces.real[l] = .xVertecesOG.real[l]*.scalex + x //recalc errythang
set .yVerteces.real[l] = .yVertecesOG.real[l]*.scaley + y
set .zVerteces.real[l] = .zVertecesOG.real[l]*.scalez + z
set l = l + 1
endloop
set modelX = x
set modelY = y
set modelZ = z
call .update()
endmethod
method rotatex takes real angle returns nothing
//rotates the object
local VECTOR3 v= VECTOR3.New_0() //will hold vertece data for passing as paramater
local VECTOR3 axis = VECTOR3.New_1(.modelX,.modelY,.modelZ) //x axis vector
local VECTOR3 normal = VECTOR3.New_1(0,0,0)
local integer l = 0
set newCoord = Quaternian.create()
set axis = Vec3Normalize (normal , axis )
//rotate entire object
loop
exitwhen l > .vertexC
set v.x = xVerteces.real[l]
set v.y = yVerteces.real[l]
set v.z = zVerteces.real[l]
call newCoord.newCoord(v,axis, angle)
//now we have our new coordinate now update current model
set xVerteces.real[l]= newCoord.X
set yVerteces.real[l]= newCoord.Y
set zVerteces.real[l]= newCoord.Z
//first of all here the object's coords also need to be updated
//this is not it the object just rotates it does not move
set l = l + 1
endloop
call .update()
call v.destroy()
call axis.destroy()
call normal.destroy()
call newCoord.destroy() //this might fix the quaternion running out of instances
endmethod
method destroy takes nothing returns nothing
local integer l = 0
call this.xVerteces.destroy()
call this.yVerteces.destroy()
call this.zVerteces.destroy()
call this.edgeConnectionData.destroy()
call this.xVertecesOG.destroy()
call this.yVertecesOG.destroy()
call this.zVertecesOG.destroy()
call this.newCoord.destroy()
loop
exitwhen l >.edgeCount
call DestroyLightning(.edgesVisual.lightning[l])
set l = l + 1
endloop
call .edgesVisual.destroy()
call .deallocate()
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Quaternian //v1 by gorillabull
/* a simple library which allows you to rotate a point in 3d space by an angle on an axis, the axis part is still being worked on */
struct Quaternian
real X
real Y
real Z
real W
method newCoord takes VECTOR3 v , VECTOR3 axis, real angle returns nothing
//this method will output new coordinates to update our object to
local Quaternian q5 = Quaternian.create()
local Quaternian w5 = Quaternian.create()
local Quaternian inv = Quaternian.create()
local Quaternian Out = Quaternian.create()
local Quaternian Output1 = Quaternian.create()
local Quaternian Output2 = Quaternian.create()
set angle = Deg2Rad(angle) //the angle is in radians
//for ze first quaternian
set q5.W = Cos(angle/2)
set q5.X = axis.x * Sin(angle /2)
set q5.Y = axis.y * Sin(angle /2)
set q5.Z = axis.z * Sin(angle /2)
//for ze second quaternian
set w5.W = 0
set w5.X = v.x
set w5.Y = v.y
set w5.Z = v.z
//for ze inverse quaternian '
set inv.X = -q5.X
set inv.Y = -q5.Y
set inv.Z= -q5.Z
set inv.W = q5.W
//le multiplication
set Output1.W = q5.W*w5.W - q5.X*w5.X - q5.Y*w5.Y - q5.Z*w5.Z
set Output1.X = q5.W*w5.X + q5.X*w5.W + q5.Y*w5.Z - q5.Z*w5.Y
set Output1.Y = q5.W*w5.Y - q5.X*w5.Z + q5.Y*w5.W + q5.Z*w5.X
set Output1.Z = q5.W*w5.Z + q5.X*w5.Y - q5.Y*w5.X + q5.Z*w5.W
set Output2.W = Output1.W*inv.W - Output1.X*inv.X - Output1.Y*inv.Y - Output1.Z*inv.Z
set Output2.X = Output1.W*inv.X + Output1.X*inv.W + Output1.Y*inv.Z - Output1.Z*inv.Y
set Output2.Y = Output1.W*inv.Y - Output1.X*inv.Z + Output1.Y*inv.W + Output1.Z*inv.X
set Output2.Z = Output1.W*inv.Z + Output1.X*inv.Y - Output1.Y*inv.X + Output1.Z*inv.W
call q5.destroy()
call w5.destroy()
call inv.destroy()
call Output1.destroy()
call Out.destroy()
//set quatOut = Output2
set this.X = Output2.X
set this.Y = Output2.Y
set this.Z = Output2.Z
set this.W = Output2.W
//return Output2
call Output2.destroy()
endmethod
endstruct
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
How to use this system:
GUI:
1. making this work in gui will be extremely tedious(this is mostly due to how the model data has to be assigned)
and it would be 1000 times easier to just stick to vjass sry but not all systems can have a gui interface
vJass:
1. there are 3 easy steps in creating a model.
A. create a global var of type modelInfo and initialize it. example
set sphere = modelInfo.create()
B. ok now you need some vertece data, that is the vertece data for your model. this data will be found in the .mdl version of your model
create any model in any modeling program or use an existing one in mdl format. certain programs which are capable of displaying
your model's mdl data (like gmax) will not even require you to save new models you create.
So when you open the mdl file, you need to scroll down to the part which looks like:
Geoset {
Vertices 468 {
{ 2.64418, -16.7716, 38.0223 },
{ 2.77655, -13.3378, 37.228 },
{ -2.84511, -7.62934, 34.9388 },
{ 2.54801, 4.35593, 96.3666 },
few things here: the numbers in the brackets are your vertece data. You will need to assign them to your model you just created
call sphere.inputVerteces ( -0.0354602, 0.284237, 26.3184 )
You will need to do this 468 times for this model but luckaly there is an easyer way. If you use notepad++ you can just create a macro
to replace everything from the model struct with the sphere.inputVerteces call followed by your data.
C. now that you have your vertece data, you need some edge data to create those beautiful lightning effects. In your open mdl file
go to the part that says:
Faces 1 1362 {
Triangles {
{ 0, 1, 2, 3, 4, 5, 5, 4, 6, 6, 4,
wow! this model has almost 1400 edges.. anyway you need to input the edge data into the model info struct like:
call sphere.inputEges(1)
each one of those little numbers gets a method call, this needs to be done 1362 times. luckaly notepad comes in handy again
this time you will need a more complex macro and i will post what macros i used at the end so u dont waste time
D. well thats it. you now have your model assigned! ..and can start creating models use
set first = modelData.create(sphere ,9,1,400,1) //
where sphere is your global variable, 9 is size and the rest is the x, y,z location of your model
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
integer array edge
modelData first
real firstZ = 0
boolean reach = false
integer edgeGenCount
endglobals
function Trig_Test_Actions takes nothing returns nothing
//***CREATE A SPHERE OR CONE OR TEAPOT******
set first = modelData.create(sphere ,9,1,400,1) // modelInfo type , scale, xyz
endfunction
//*****DEMO STUFF BELOW ***** (for model animation..yes you can create animations)
///*** WARNING! animation functions may cause massive lag for complex models (>200 edges)******\\\\
//disable them for those
function loops takes nothing returns nothing
local real amount = 75
local real down = first.scalez /1.2
local real up = first.scalez*1.05
if firstZ < 900 and reach == false then
set firstZ = firstZ +amount
call first.scale(9,9,(up))
endif
if firstZ >= 900 then
set reach = true
set first.scalez = 9
endif
if reach == true then
set firstZ = firstZ - amount
call first.scale(9,9,(down))
endif
if firstZ <= 0 then
set reach = false
set first.scalez = 9
endif
call first.move(1,1,firstZ)
endfunction
function spins takes nothing returns nothing
call first.rotatex(20)
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
//---------------------------------------------------------
local timer t = CreateTimer()
local timer t2 = CreateTimer()
call TimerStart(t, .05, true , function loops)
call TimerStart(t2,.03, true , function spins)
//----------------------------------------------------
set gg_trg_Test = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Test, 2.00 )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
//TESH.scrollpos=360
//TESH.alwaysfold=0
/*********************************************************************************************
* Introduction
* -----------------------------
* This is a library which is capable of generating Models similar to those inside wc3. You might be wondering what
* kind of models I am talking about. With this you can generate the same things as unit projectiles, trees, simple doodads
* like barrel or rock, however they will not have any texture. This only generates the lines between each vertece
* or point in the model. Models inside wc3 (peasants, barracks, really anything that moves) are made up of a
* collection of points in space which are connected with lines. Later the texture is applied which gives the model
* a finished look. This system is not capable of applying textures to the models it generates however it is
* capable of generating the model's points and connecting them with lightning. Using this method you will not
* be capable of getting a identical model look like the ones in the game because you will not be able to generate
* a texture, however you will get a decent representation of the model. There are some limitations here. How to generate
* a model with this system? Pls look at tutorial below. Limitation are of course caused by wc3 thread limit and so
* if you want to use this system effectively you have to consider those limitations.
* Limitation 1: Due to wc3's thraed limit you cant create very complex models. If fact the only thing that you
* should create with this system are simple models like projectiles, destructables, or anything that has
* not too many polygons
* Again due to thread limit you cannot have any animations simply because they require too many operations.
*************************************************************************************************************
* Generating a model - Tutorial
* ------------------------------
* Required external Tools - Notepad++
*
* 1. First thing you need is an already existing model in mdl format. Also if you are using any kind of model editor
* which is capable of outputting the model's info into mdl format you could use it. After creating your model
* with an .mdl format go ahead and open it. It probably wont have any animations but if it does scroll down to the
* part of which looks like this:
Geoset {
Vertices 302 {
{ -2.22847, -4.5126, 90.3149 },
{ -2.86841, -2.59221, 92.0554 },
{ -5.90394, 0.006, 90.3456 },
{ -6.64947, 7.36909, 27.8454 },
{ 1.56159, 13.7381, 35.8622 },
{ 0.86169, 12.2178, 29.2713 },
{ 8.90468, 6.93236, 27.4755 },
{ 10.265, 6.63715, 36.1995 },
{ -3.69442, 0.34387, 32.9351 },
. . . . . .
* copy everything after Vertices 302 { and in the system go to this part:
call .T ( -0.0354602, 0.284237, 26.3184 )
call .T ( -0.035461, 18.8941, 18.6099 )
call .T ( -13.1946, 13.4434, 18.6099 )
call .T ( -18.6453, 0.284235, 18.6099 )
call .T ( -13.1946, -12.8749, 18.6099 )
call .T ( -0.0354577, -18.3256, 18.6099 )
. . . . . . . . . . .
* here you must input the values from above in the exact order. If your model has an unusually large number
* of verteces then you can use a program like notepad ++ to do the text replacement. However i am not going to
* make a tutorial on how to do this as the system does not rly support models with a lot of verteces.
*
* 2. Ok so far you have all your model's info and there is a few more things that you have to do. Notice
* the number after Vertices 302{ } in the above example. This number (302) indicates that the model has 302
* verteces or 302 points in space. You shouldn't use this system with models that have any more than 200
* verteces because of the limits mentioned above. Ok so now set the constand integer VERTECES which is below
* to the number of verteces in your model.
*
* 3. Almost there. Now we just have to define what to connect with lighting and lucky for us the .mdl file
* provides that for us. Without having moved from your last specified location in the .mdl file scroll down to
* the part that looks like this:
Faces 1 810 {
Triangles {
{ 0, 1, 2, 3, 4, 5, 6, 5, 4, 4, 7, 6, 8, 6,
* This is the part of the model which defines its triangles. ALL models no matter where they exist weither in
* video games or cgi movies use triangles like this. This particular model has 810 triangles which is quite a lot
* and not compatible with this system but it will do for the tutorial. So what you do now is first copy all these
* numbers { 0, 1, 2, 3, 4, 5, 6, 5, 4, 4, 7, 6, 8, 6, until the last one into notepad++. Earlier I said I wont
* make a tutorial about doing this but i guess i should. Ok in notepad++ copy the numbers. Now what you have to do
* is assign them to the variable at the bottom of this system:
set edge[cb] = 0
set cb = cb + 1
set edge[cb] = 1
set cb = cb + 1
set edge[cb] = 1
set cb = cb + 1
set edge[cb] = 2
set cb = cb + 1
set edge[cb] = 0
set cb = cb + 1
set edge[cb] = 2
set cb = cb + 1
* The first number goes into the first edge[cb] variable and the next one in the next. You can use notpad++ to
* automatically place them in the variable and heres how:
* a. Having pasted all the numbers in notepad++ they should look like { 0, 1, 2, 3, 4, 5, 6, 5, . . . }.
* First Press Ctrl+H and that will open up the find/replace window. In the Find What field write a "," and
* in the replace with field write a "\n" both without the " ". Go down to the box which says search mode and
* click on the Extended circle, then hit the replace all button to the right.
* b. Ok now you should have a nice column of numbers. Next thing u wanna do is put in this number into the variable.
* To do this first copy "set edge[cb] = ", and don't paste it anywhere. Click behind the very first number
* of the column like so:
{ | 0 <cursor behind 0
1
2
3
4
5
6
5
4
4
7
6
8
6
* Ok now you are ready to record. Click on the Red Circle on the top toolbar which looks like a record button and
* paste what you had copied earlier. Ok now press the end button on your keyboard. This will take you to the
* end of the line. Now press the right arrow key and this will take you to the beginning of the next line.
* Write out "set cb = cb + 1 " and press enter. Ok now you have completed your replacement sequence, click the
* black square next to the recording button. Now you can either play back your sequence once by clicking on the
* blue triangle next to the stop button or clicking on the double triangle button to execute the sequence
* multiple times. Afterwards your work should look like this:
set edge[cb] = 0
set cb = cb + 1
set edge[cb] = 1
set cb = cb + 1
set edge[cb] = 1
set cb = cb + 1
set edge[cb] = 2
set cb = cb + 1
set edge[cb] = 0
set cb = cb + 1
set edge[cb] = 2
* With the numbers being inside of edge[cb].
* Next you have to specify the number of faces set FECES = in this case Faces 1 810 so FECES = 810
* Now if you did everything correctly your model should be generated inside wc3 after you call the generateNewMObject
* method and rotated after you call the rotate() method.
*
* A little on how the models are being generated and rotated
* ------------------------------------------------------------
* Each vertece has its x\y\z values in a specific variable these values come from the .T method calls
* The lightning is generated based on the edge[cb] values you have specified below through the method .L call
* The entire model is rotated using quaternians which is nothing more than mere multiplication and addition.
* Quaternians allow you to generate a 3d model around an axis which in this case is defined by a normalized vector.
* I wont be explaining vectors and quaternians but ill give u an example on how they work in this system.
local VECTOR3 axe = VECTOR3.New_1(34,56,11)
* This above this the axis around which our model will be rotating.
* If this were to be done on a 2d place the axis would look like this:
|
y |
p |
l 5| /* (3,5)
a | /
n | /
e | /
|/___________________________
3 x plane
Thus our model will rotate around the (3,5) vector, this works the same way in 3d.
*
* After we have specified our axis we can generate our model. The below values are very simple. The first one
* is our axis, the second one is the angle towards which our model will be rotating to. The third one is the
* scale of the model (anything above 20 is very large) and the 4th,5th and 6th are our model's x\y\z offsets from
* the center of the map, in other words our model's location
set one = Mmodel.generateNewMmodel(axe, 5, 11, 3,5, 8)
*
* And thats rly all there is to it. Hope this sheds some light on what to use this for.
*/
*/
library Objekt initializer Init uses Math/*
*************************************************
* Description
* -----------------------------
* Library for emulating SIMPLE (<200 triangle) models in WC3: The Frozen Throne
* Due to wc3's thread opeartion limit advanced animation features are not included
*
*
* Credits to:
* -----------------------------
* -GhostWolf for explaining the some of the math
*
*
* Fields
* -----------------------------
*
*
* Methods
* -----------------------------
*
* static method generateNewMObject takes VECTOR3 anus , real angur, real scule , real a , real b , real c returns MObject
* ~generates a model inside wc3 based on your specifications
*
* method rotate takes nothing returns nothing
* ~rotates your object on an axis using the angle as a difference betveen the last position and the new OneOnOneInitPlayerSlots
*
*****************************************************************************
*
* .. by gorillabull
*/
globals
private constant integer TRIANGLE_LIMIT = 200 //wc3 operation limit limits us to this
private integer array edge //used for creating triangles
private constant integer FECES = 144 // since our MObject will only have this many
private constant integer VERTECES = 26 // how many verteces our objekt will have
MObject one
MObject two
MObject three
MObject four
MObject five
MObject six
MObject seven
MObject eight
MObject nine
MObject ten
MObject eleven
integer vCount = 0
endglobals
struct MObject
real MObjectX
real MObjectY
real MObjectZ
integer sdcount = 0
VECTOR3 array vertece [TRIANGLE_LIMIT] //200 means that there is a limit of 200 triangles to each MObject.. which is quite small but will allow us to create more instnaces of it ^^^
VECTOR3 axi
VECTOR3 normal
LocationHolder array lightLoc [TRIANGLE_LIMIT] //this should have the exact number as "vertece" since it only holds the poitns of light or w/e
Quaternian quatOut //used for rotation
lightning array Light [TRIANGLE_LIMIT] //again.. 200 is max same as above
real angle
real scale
static integer oCount =0
static method generateNewMObject takes VECTOR3 anus , real angur, real scule , real a , real b , real c returns MObject
local MObject this = MObject.create()
local integer l = 0
set .normal = VECTOR3.create()
set .sdcount = 0
set l = 0
loop
exitwhen l > VERTECES
set .lightLoc[l] = LocationHolder.create()
set l = l + 1
endloop
set .quatOut = Quaternian.create() //destroy this lator
set .axi = anus// this determines the axis which we will be rotating around, think of it
//as a point in space in a 3d cartesian coordinate system with a line from 0,0,0 drawn to this point
//the line represents the axis
//remember to destroy this one as well
set .axi = Vec3Normalize (normal , axi )
set .angle = angur //the amount of rotation on each pass, large angles give a lot of rotation
set .scale = scule
set .MObjectX = a
set .MObjectY = b
set .MObjectZ = c
if 1 == 1 then
/* these here are the coords for a low triangle sphere i call it low triangle because it has very few triangles
and that causes it to kinda look like a cube.. anyways the low poly count is nesessary because of wc3's op limit
*/
//YOU CAN CREATE ****ANY**** MObject YOU LIKE AS LONG AS IT HAS NO MORE THAN 199 TRIANGLES
method rotate takes nothing returns nothing
local integer l = 0
loop
exitwhen .lightLoc[l] == 0
call .quatOut.Q(.vertece[l] , .axi, .angle ) // //define the neW location
call .lightLoc[l].assign(.quatOut.X, .quatOut.Y, .quatOut.Z )
call .vertece[l].vec3Assign(.quatOut.X,.quatOut.Y,.quatOut.Z)
set l = l + 1
endloop
set l = 0
loop
exitwhen .Light[l] == null
call MoveLightningEx(.Light[l], true , .lightLoc[edge[l]].locx , .lightLoc[edge[l]].locy , .lightLoc[edge[l]].locz , .lightLoc[edge[l+1]].locx, .lightLoc[edge[l+1]].locy ,.lightLoc[edge[l+1]].locz )
set l = l + 1
endloop
set l = 0
endmethod
endstruct
struct Quaternian
real X
real Y
real Z
real W
method Q takes VECTOR3 v, VECTOR3 axis, real angle returns nothing
local Quaternian q5 = Quaternian.create()
local Quaternian w5 = Quaternian.create()
local Quaternian inv = Quaternian.create()
local Quaternian Out = Quaternian.create()
local Quaternian Output1 = Quaternian.create()
local Quaternian Output2 = Quaternian.create()
set angle = Deg2Rad(angle) //the angle is in radians
//for ze first quaternian
set q5.W = Cos(angle/2)
set q5.X = axis.x * Sin(angle /2)
set q5.Y = axis.y * Sin(angle /2)
set q5.Z = axis.z * Sin(angle /2)
//for ze second quaternian
set w5.W = 0
set w5.X = v.x
set w5.Y = v.y
set w5.Z = v.z
//for ze inverse quaternian '
set inv.X = -q5.X
set inv.Y = -q5.Y
set inv.Z= -q5.Z
set inv.W = q5.W
//le multiplication
set Output1.W = q5.W*w5.W - q5.X*w5.X - q5.Y*w5.Y - q5.Z*w5.Z
set Output1.X = q5.W*w5.X + q5.X*w5.W + q5.Y*w5.Z - q5.Z*w5.Y
set Output1.Y = q5.W*w5.Y - q5.X*w5.Z + q5.Y*w5.W + q5.Z*w5.X
set Output1.Z = q5.W*w5.Z + q5.X*w5.Y - q5.Y*w5.X + q5.Z*w5.W
set Output2.W = Output1.W*inv.W - Output1.X*inv.X - Output1.Y*inv.Y - Output1.Z*inv.Z
set Output2.X = Output1.W*inv.X + Output1.X*inv.W + Output1.Y*inv.Z - Output1.Z*inv.Y
set Output2.Y = Output1.W*inv.Y - Output1.X*inv.Z + Output1.Y*inv.W + Output1.Z*inv.X
set Output2.Z = Output1.W*inv.Z + Output1.X*inv.Y - Output1.Y*inv.X + Output1.Z*inv.W
/*
set Out = Quaternian.QMult(q5,w5,inv) // q*w*inv .. ORDER MATTERS
*/
call q5.destroy()
call w5.destroy()
call inv.destroy()
call Output1.destroy()
call Out.destroy()
//set quatOut = Output2
set this.X = Output2.X
set this.Y = Output2.Y
set this.Z = Output2.Z
set this.W = Output2.W
//return Output2
call Output2.destroy()
endmethod
static method create takes nothing returns Quaternian
local Quaternian this = Quaternian.allocate()
return this
endmethod
endstruct
endstruct
method destroy takes nothing returns nothing
local integer l = 0
loop
exitwhen l >.sdcount
call .vertece[l].destroy()
set l = l + 1
endloop
set l = 0
call .axi.destroy()
call .quatOut.destroy()
call .normal.destroy()
loop
exitwhen .lightLoc[l] == 0
call .lightLoc[l].destroy()
set l = l + 1
endloop
call this.deallocate()
endmethod
function rotateOs takes nothing returns nothing
// this is how you would rotate yar MObject you can also change its x,y,z values etc..
call one.rotate()
// call two.rotate()
// call three.rotate()
// call five.rotate()
endfunction
//===========================================================================
function Init takes nothing returns nothing
local VECTOR3 axe = VECTOR3.New_1(34,56,11) // rotate around the z axis dont worry about normalizing it as this
//is done inside the struct
/*if you want the MObject to rotate around a close point to the axis then create the axis from the same
coords as you would use on the MObject otherwise your MObject will rotate around the middle of the map ; d */
set one = MObject.generateNewMObject(axe, 5, 11, 3,5, 8)
call axe.vec3Assign(0,2000,400)
// set two = MObject.generateNewMObject(axe /*axis*/ , 7 /*angle*/ , 13 /*size*/ , /*x y z */ 0 , 900 , 600)
// call axe.vec3Assign(0,0,1)
// set three = MObject.generateNewMObject(axe, 4, 13, 0 , 0 , 600)
call axe.vec3Assign(200,400,600)
// set five = MObject.generateNewMObject(axe, -2, 7, 200 , 0 , 600)
set gg_trg_Objekt_old = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Objekt_old, .03125, true )
call TriggerAddAction( gg_trg_Objekt_old, function rotateOs )
//these variables just define the creation of lighting they tell how to connect it
endfunction
endlibrary