XVR / Halca basics Virtual Environments 2009 Aitor Rovira Will Steptoe
XVR functions onInit(){}//initialize all objects onFrame()//rendering instruction. This is the //only place where the openGL context is //available. { SceneBegin();... SceneEnd(); } onTimer(){} //frame independent source code onExit(){} //free allocated memory and kill all processes
Interaction Keyboard() Mouse() CVmJoystick() GUI Tracking device: getTrackerPos(TRACKER_ID); getTrackerRot(TRACKER_ID); getTrackerJoy(TRACKER_ID); getTrackerButtons(TRACKER_ID);
Navigation – Head Tracking Head tracker perspective is implicit in the application: SceneSetParam(VR_HEADTRACKER,1);
Navigation - Camera var CameraPos = CameraGetPosition(); var CameraDir = CameraGetDirection(); … CameraSetPosition(CameraPos); CameraSetDirection(CameraDir);
Scene render.aam contains the information about meshes and materials. (The exporter is available for Max and Blender) Var mesh; Var object; onInit() { mesh = CVmNewMesh("myAAMfile.aam"); obj = CVmObj(); obj.LinkToMesh(mesh); } onFrame() { obj.Draw(); }
Character animation – Halca HALCA library for character animation. Halca input format: cal3D. Exporter available for Max. Exporting in cal3D: Install plug-in (place.dll and.dle into Max folder) How to export: –New export options in File Export. –Drag and drop.ms script file.
Character Animation – cal3D Cal3D files:.XSF /.CSF: skeleton.XMF /.CMF: mesh.XSF /.CSF: material.XAF /.CAF: animation
Character animation Include avatars.s3d in the project (don’t modify this file!) Call initAvatars(); Load Avatars using Avatars.AddCharacter(, ); Run an animation using any of these instructions: Avatars.ExeAct(),Avatars.ExeActPart, Avatars.BlendCycle()
References XVR website: HALCA website XVR wiki: XVR forums: XVR documentation