/************************************************************* Bastien BOURINEAU 03/2004 **************************************************************/ /**************** VIEWER Configuration ******************/ // - Common Configuration - var StandAloneView = 1;; // 1 Draw the Open file menu, 0 if not var MoveMode = 1;; // Default Move Mode : 1 -> Examine Mode - 2 -> Walk mode - 3 -> Fly mode var autoAnim = 1;; // Launch all animated object in loop var autoLight = 1;; // use the M3d lights var autoParticle = 1;; // launch all particle emitter var autoFit = 1;; // Fit to screen on default view var View3D = 0;; // not implemented yet var Back3d = 0;; // Show the background picture on 3D //------ - Menu - var ExamMnu = "Examine";; // Text menu 'Examine' var WalkMnu = "Walk";; // Text menu 'Walk' var FlyMnu = "Fly";; // Text menu 'Fly' var WireMnu = "Wire render";; // Text menu 'Wire render' var BackMnu = "Background color";; // Text menu 'Background color' var FitMnu = "Fit to screen";; // Text menu 'Fit to screen' var PartMnu = "Restart Particle System";; // Text menu 'Restart Particle System' var OpenMnu = "Open m3d";; // Text menu 'Open M3d' var AboutMnu = "About";; // Text menu 'About' var QuitMnu = "Quit";; // Text menu 'Quit' var AboutTitle = "Scol Viewer";; // Text of the About popup title var AboutText = "Scol Viewer V1.0\n by Arkeon\n Mail : bastienb@wanadoo.fr\n 03/2004";; // Text of the About popup //------ - window - var winW = 800;; // Windows widht in pixel var winH = 600;; // Windows height in pixel var LoadingBitmap = "tools/scol_viewer/2d/loading.jpg";; // Loading bitmap path var BackBitmap = "tools/scol_viewer/2d/";; // Back bitmap path var BackTransColor = [255 255 255];; // Back bitmap transparent Color RVB //------ - Mouse - var HandCursorFile = "tools/scol_viewer/2d/hand.bmp";; // Hand cursor bitmap //------ - Sound - var SndClickPath = "tools/scol_viewer/snd/click.mp3";; // Click Sound file (wav, mp3) var SndStartPath = "tools/scol_viewer/snd/start.mp3";; // Openfile Sound file (wav, mp3) //------ - 3D - var BackgroundColor = [255 255 255];; // 3D Background Color RVB var ObjFxfile = "tools/scol_viewer/config.ini";; // Config ini file var scenefile = "tools/scol_viewer/m3d/viewer.m3d";; // Default M3D file for applet mode var camfile = "tools/scol_viewer/m3d/cam/cam.m3d";; // Default Camera M3D file var camfile3D = "tools/scol_viewer/m3d/cam/cam_3d.m3d";; // Default Left Camera M3D file //------ - Light - var LightAng = 180;; // Default Light Angular var LightConst = 450;; // Default Light Constant var LightQuad = 0;; // Default Light Quadri var LightType = 3;; // Default Light type : 1 Ambient - 2 PARA - 3 OMNI - 4 SPOT var LightX = 0;; // Defailt Light X position var LightY = 15000;; // Defailt Light Y position var LightZ = 0;; // Defailt Light Z position //----- - Camera Configuration - var DefCamdist = 1500;; // Default Camera distance in Examine mode var CamangX = (-4000);; // Default X Camera rotation in Examine mode var CamangY = (-4000);; // Default Y Camera rotation in Examine mode var MinCamdist = 30;; // Minimum Camera distance in Examine mode var DefMaxCamdist = 4500;; // Maximum Camera distance in Examine mode var ZoomStep = 30;; // MouseWeel Zoom step in Examine mode var MinYrot = 16000;; // Minimum Y Camera rotation var MaxYrot = (-16000);; // Maximum Y Camera rotation /**************** viewer variable Types ******************/ // - Win - typeof Win = ObjWin;; typeof load_bitmap = ObjBitmap;; typeof load_bitmap2 = ObjBitmap;; typeof back_bitmap = ObjBitmap;; typeof loadScreen = I;; typeof CurrentDir = S;; // - Menu - typeof ContextMenu = ObjMenu;; typeof EMenu = ObjMenuItem;; typeof WMenu = ObjMenuItem;; typeof FMenu = ObjMenuItem;; typeof RMenu = ObjMenuItem;; typeof CMenu = ObjMenuItem;; typeof IMenu = ObjMenuItem;; typeof PMenu = ObjMenuItem;; typeof OMenu = ObjMenuItem;; typeof AMenu = ObjMenuItem;; typeof QMenu = ObjMenuItem;; // - Mouse - typeof iClickStatus = I;; typeof iClickX = I;; typeof iClickY = I;; var CLICK_NO = 0;; var CLICK_YES = 1;; typeof iMoveX = I;; typeof iMoveY = I;; typeof MoveClickStatus = I;; var MVCLICK_NO = 0;; var MVCLICK_YES = 1;; typeof WeelDelta = I ;; var WeelStatus = 0 ;; typeof csrHand = ObjCursor;; typeof bmpHand = ObjBitmap;; var handon = 0;; // - Sound - typeof SndClick= AsSnd;; typeof SndStart= AsSnd;; // - 3d - typeof Session = S3d;; typeof Buffer = ObjSurface;; typeof BufferLeft = ObjSurface;; typeof BufferRight = ObjSurface;; typeof LeftBitmap = ObjBitmap;; typeof RightBitmap = ObjBitmap;; typeof timer_paint=Timer;; typeof timer_Anim=Timer;; typeof Render = I;; var Rendu_filaire = 0;; // in wired mode or not typeof H3dFileList = [[S r1]r1];; // - Light - typeof h3dALight = H3d;; typeof h3dShlLight = H3d;; typeof h3dCLight = H3d;; // - Camera - typeof onturn = I;; typeof ObjDist = I;; typeof Camera = H3d;; typeof CameraR = H3d;; typeof CameraL = H3d;; typeof shellCam = H3d;; typeof shell = H3d;; typeof Camdist = I;; typeof MaxCamdist = I;; var fAngMin = 0.0;; typeof fAngMax = F;; typeof fAngInc = F;; var fRadius = 300.0;; var fAngleStep = 8.0;; // - Struct FX - struct TH3dFx = [ H3dName : S, FxType : S, FxAnim : S, StartFrame : S, StopFrame : S, CamLink : S ]mkTH3dFx;; // - Struct Anims - struct TetatAnim = [ ETATANIM_H3d : H3d, /* H3d */ ETATANIM_actif : I, /* vaut 1 si l'animation est active et 0 si non. */ ETATANIM_lecture : I, /* vaut 0 si l'animation est stoppée, 1 si lecture simple, 2 si boucle */ ETATANIM_vitesse : I, /* Précise la vitesse en cours en nombre de frames par seconde. */ ETATANIM_startframe : I, ETATANIM_stopframe : I, ETATANIM_taille : I, /* Taille de l'animation, en nombre de frames */ ETATANIM_frame : I, /* Numéro de frame en cours de lecture. */ ETATANIM_frame_zero : I /* Numéro de frame en cours de lecture. Permet de savoir si la frame zero est active (0) ou pas (1)*/ ]mkEtatAnim;; typeof AnimList = [TetatAnim r1];; typeof H3dFromM3dList = [H3d r1];; typeof LightFromM3dList = [H3d r1];; typeof EmitFromM3dList = [H3d r1];; // Common fun fun apply_on_list(l,f,x)= if l==nil then 0 else let l -> [a nxt] in (exec f with [a x]; apply_on_list nxt f x);; fun getPathFile (longfile, file)= if (longfile==nil) || (strlen longfile)==0 || (nth_char longfile ((strlen longfile)-1)) == '/ then [longfile file] else getPathFile substr longfile 0 (strlen longfile)-1 strcat substr longfile ((strlen longfile)-1) 1 file;;