GIANTS Game Engine v4 DocumentationTable of Contents
OverviewIntroductionGIANTS Engine is a real-time 3D game engine with corresponding content pipeline tools. Its flexible and modular design supports multiple platforms and game genres. Key featuresGraphics
Physics
Animations
Artificial Intelligence
Tools
Miscellaneous
Runtime development key short-cuts
Console Command ReferenceenableFramerateLimitDescriptionEnable/disable frame per second limiter exit, quit or qDescriptionQuits application framerateLimitFPSDescriptionFrame per second limit attribute globalClipDistanceDescriptionGlobal clipping distance. Additional distance clipping per object (at center of object). globalCullOverrideDescriptionGlobal cull override. If true no visibility culling is used. listEntitiesDescriptionPrint detailed entity list listResourcesDescriptionPrint detailed resource list reloadDescriptionReloads resource with given name reloadAllDescriptionReload all resources with given type showDebugAudioSourceDescriptionShow debug audio sources showDebugLightSourcesDescriptionShow debug lights showDebugRenderingDescriptionShow debug rendering. Global switch for all debug rendering. showShapeBoundingVolumeDescriptionShow shape bounding volumes showTransformGroupFramesDescriptionShow debug transform group frames showFpsDescriptionShow frames per second sortGeometryDescriptionSort render queue by material sort id parallelRenderingAndPhysicsDescriptionEnable parallel rendering and physics Function ReferenceGeneral Function ReferencePrint to console Definition function print(arg1, ...) Arguments
sourceDescriptionSource script file Definition function source(filename) Arguments
requestExitDescriptionRequest application to exit at the end of this frame Definition function requestExit() renderTextDescriptionRender text to viewport Definition function renderText(float x, float y, float size, string str) Arguments
setTextColorDescriptionSet the text color to be used for the following renderText calls Definition function setTextColor(float r, float g, float b, float a) Arguments
setTextBoldDescriptionSet the text boldness to be used for the following renderText calls Definition function setTextBold(boolean isBold) Arguments
setTextAlignmentDescriptionSet the text alignment to be used for the following renderText calls Definition function setTextAlignment(integer alignment) Arguments
setTextWrapWidthDescriptionSet the text wrap width to be used for the following renderText calls Definition function setTextWrapWidth(float wrapWidth) Arguments
Notes since v4.1.5 drawDebugPointDescriptionRender a point. Only use for debug rendering Definition function drawDebugPoint(float x, float y, float z, float r, float g, float b, float a) Arguments
Notes since v4.1.5 drawDebugLineDescriptionRender a line. Only use for debug rendering Definition function drawDebugLine(float x0, float y0, float z0, float r0, float g0, float b0, float x1, float y1, float z1, float r1, float g1, float b1) Arguments
Notes since v4.1.5 drawDebugArrowDescriptionRender an arrow. Only use for debug rendering Definition function drawDebugArrow(float x, float y, float z, float dirX, float dirY, float dirZ, float tangX, float tangY, float tangZ, float r, float g, float b) Arguments
Notes since v4.1.5 asciiToUtf8DescriptionConverts an ascii latin1 (ISO 88859-1) encoded string to an utf8 string Definition function asciiToUtf8(string asciiString) Arguments Return Values
Notes since v4.1.5 unicodeToUtf8DescriptionConverts an unicode value to an utf8 string Definition function unicodeToUtf8(integer unicode) Arguments Return Values
Notes since v4.1.5 utf8StrlenDescriptionReturns the length of an utf8 formated string Definition function utf8Strlen(string utf8string) Arguments Return Values
Notes since v4.1.5 utf8SubstrDescriptionReturns a sub string of an utf8 formated string Definition function utf8Substr(string utf8string, integer startIndex, integer length) Arguments Return Values
Notes since v4.1.5 setFogDescriptionSet fog properties Definition function setFog(string fogType, float startDistanceOrDensity, float endDistance, float r, float g, float b) Arguments
setVolumeFogDescriptionSet volume fog properties Definition function setVolumeFog(string fogType, float startDistanceOrDensity, float endDistance, float yPlane, float r, float g, float b) Arguments
wrapMousePositionDescriptionWrap mouse position Definition function wrapMousePosition(float x, float y) Arguments
setShowMouseCursorDescriptionSet show mouse cursor Definition function setShowMouseCursor(boolean state) Arguments
setCaptionDescriptionSet caption Definition function setCaption(string caption) Arguments
loadI3DFileDescriptionLoad I3D file Definition function loadI3DFile(string filename) Arguments Return Values
projectDescriptionTransform vector from world space into screen space Definition function project(float wx, float wy, float wz) Arguments
Return Values
unProjectDescriptionTransform vector from screen space into world space Definition function unProject(float sx, float sy, float sz) Arguments
Return Values
addTimerDescriptionAdds timer callback function Definition function addTimer(float time, string timerFunctionCallback, object instance) Arguments
Return Values
setTimerTimeDescriptionSet timer interval time Definition function setTimerTime(integer timerId, float time) Arguments
saveScreenshotDescriptionSave screenshot Definition function saveScreenshot(string filename) Arguments
getAppBasePathDescriptionGet application base path Definition function getAppBasePath() Return Values
getUserProfileAppPathDescriptionGet user profile application path Definition function getUserProfileAppPath() Return Values
copyFileDescriptionGet copy file Definition function copyFile(string sourceFile, string destinationFile, boolean overwrite) Arguments
getFilesDescriptionGet all files of a directory Definition function getFiles(string path, string fileFunctionCallback, object instance) Arguments
Return Values
Entity Function ReferencedeleteDescriptionDelete Entity/Object Definition function delete(integer objectId) Arguments
getClassNameDescriptionGet class name of object Definition function getClassName(integer objectId) Arguments
Return Values
addDeleteListenerDescriptionAdd a delete listener Definition function addDeleteListener(integer objectId, string deleteFunctionCallback, object targetObject) Arguments
Return Values
removeDeleteListenerDescriptionRemove a delete listener. Note: it is important to call removeDeleteListener for each addDeleteListener call to avoid memory leaks Definition function removeDeleteListener(integer objectId, integer listenerId) Arguments
Node Function ReferencegetParentDescriptionGet parent id Definition function getParent(integer objectId) Arguments
Return Values
linkDescriptionLink node to another node Definition function link(integer parentNodeId, integer childNodeId) Arguments
unlinkDescriptionUnlink node from parent Definition function unlink(integer objectId) Arguments
getNumOfChildrenDescriptionGet number of children Definition function getNumOfChildren(integer objectId) Arguments
Return Values
getChildAtDescriptionGet child id at given index Definition function getChildAt(integer objectId, integer index) Arguments
Return Values
getChildDescriptionGet child id Definition function getChild(integer objectId, string childName) Arguments
Return Values
getNameDescriptionGet object name Definition function getName(integer objectId) Arguments
Return Values
setNameDescriptionSet object name Definition function setName(integer objectId, string objectName) Arguments
removeChildAtDescriptionRemove child at given index Definition function removeChildAt(integer objectId, integer index) Arguments
Scenegraph Function ReferencecreateTransformGroupDescriptionCreate transform group Definition function createTransformGroup(string transformName) Arguments
Return Values
setTranslationDescriptionSet translation of a transform object Definition function setTranslation(integer transformId, float x, float y, float z) Arguments
getTranslationDescriptionGet translation of a transform object Definition function getTranslation(integer transformId) Arguments
Return Values
getWorldTranslationDescriptionGet world translation of a transform object Definition function getWorldTranslation(integer transformId) Arguments
Return Values
setRotationDescriptionSet euler rotation of a transform object. Order ZY'X'' Definition function setRotation(integer transformId, float x, float y, float z) Arguments
getRotationDescriptionGet rotation of a transform object Definition function getRotation(integer transformId) Arguments
Return Values
getWorldRotationDescriptionGet world rotation of a transform object Definition function getWorldRotation(integer transformId) Arguments
Return Values
setDirectionDescriptionSet the direction of an object, the positive z-axis points towards the given direction. The y-axis lies in the direction-up-plane. Definition function setDirection(integer transformId, float x, float y, float z, float upX, float upY, float upZ) Arguments
setScaleDescriptionSet scale of a transform object Definition function setScale(integer transformId, float x, float y, float z) Arguments
getScaleDescriptionGet scale of a transform object Definition function getScale(integer transformId) Arguments
Return Values
setVisibilityDescriptionSet transform object visibility Definition function setVisibility(integer transformId, boolean visibility) Arguments
getVisibilityDescriptionGet transform object visibility Definition function getVisibility(integer transformId) Arguments
Return Values
cloneDescriptionClone scenegraph object Definition function clone(integer objectId, boolean groupUnderParent) Arguments
Return Values
setRootNodeDescriptionSet scenegraph root node used by the given viewport Definition function setRootNode(integer rootNodeId, integer viewportIndex) Arguments
getRootNodeDescriptionGet scenegraph root node used by the given viewport Definition function getRootNode(integer viewportIndex) Arguments
Return Values
localToWorldDescriptionLocal space to world space transformation Definition function localToWorld(integer transformId, float x, float y, float z) Arguments
Return Values
localDirectionToWorldDescriptionLocal space to world space transformation, only direction without translation Definition function localDirectionToWorld(integer transformId, float x, float y, float z) Arguments
Return Values
worldToLocalDescriptionWorld space to local space transformation Definition function worldToLocal(integer transformId, float x, float y, float z) Arguments
Return Values
worldDirectionToLocalDescriptionWorld space to local space transformation, only direction without translation Definition function worldDirectionToLocal(integer transformId, float x, float y, float z) Arguments
Return Values
getAnimCharacterSetDescriptionGet animation character set id Definition function getAnimCharacterSet(integer objectId) Arguments
Return Values
setUserAttributeDescriptionSet user attribute value Definition function setUserAttribute(integer objectId, string attributeName, string typeName, integer/float/boolean/string value) Arguments
getUserAttributeDescriptionGet user attribute value Definition function getUserAttribute(integer objectId, string attributeName) Arguments
Return Values
setObjectMaskDescriptionSet object mask Definition function setObjectMask(integer objectId, integer mask) Arguments
getObjectMaskDescriptionGet object mask Definition function getObjectMask(integer objectId) Arguments
Return Values
getTerrainHeightAtWorldPosDescriptionget the terrain height at the given position Definition function getTerrainHeightAtWorldPos(integer terrainId, float x, float y, float z) Arguments
Return Values
Lighting Function ReferencesetAmbientColorDescriptionSet global ambient color Definition function setAmbientColor(float r, float g, float b) Arguments
getLightDiffuseColorDescriptionGet diffuse color of a light Definition function getLightDiffuseColor(integer lightId) Arguments
Return Values
setLightDiffuseColorDescriptionSet diffuse color of a light Definition function setLightDiffuseColor(integer lightId, float r, float g, float b) Arguments
getLightSpecularColorDescriptionGet specular color of a light Definition function getLightSpecularColor(integer lightId) Arguments
Return Values
setLightSpecularColorDescriptionSet specular color of a light Definition function setLightSpecularColor(integer lightId, float r, float g, float b) Arguments
getLightRangeDescriptionGet range of a light Definition function getLightRange(integer lightId) Arguments
Return Values
setLightRangeDescriptionSet range of a light Definition function setLightRange(integer lightId, float range) Arguments
Camera Function ReferencecreateCameraDescriptionCreate camera Definition function createCamera(string cameraName, float fovy, float nearClip, float farClip) Arguments
setCameraDescriptionSet currently used camera by the given viewport Definition function setCamera(integer cameraId, integer viewportIndex) Arguments
getCameraDescriptionGet currently used camera by the given viewport Definition function getCamera(integer viewportIndex) Arguments
Return Values
setViewportDescriptionSet the dimensions of the given viewport Definition function setViewport(integer viewportIndex, float left, float top, float width, float height) Arguments
Notes since v4.1.5 setFovyDescriptionSet the field of view angle Definition function setFovy(integer cameraId, float fovy) Arguments
getFovyDescriptionGet the field of view angle Definition function getFovy(integer cameraId) Arguments
Return Values
setNearClipDescriptionSet the near clip distance Definition function setNearClip(integer cameraId, float nearClip) Arguments
getNearClipDescriptionGet the near clip distance Definition function getNearClip(integer cameraId) Arguments
Return Values
setFarClipDescriptionSet the far clip distance Definition function setFarClip(integer cameraId, float farClip) Arguments
getFarClipDescriptionGet the far clip distance Definition function getFarClip(integer cameraId) Arguments
Return Values
aimCameraDescriptionAim camera (spring/damper) Definition function aimCamera(integer cameraId, float x, float y, float z, float distance, float dt, float springStrength) Arguments
Shape Function ReferencesetShaderParameterDescriptionSet shader parameter Definition function setShaderParameter(integer shapeId, string parameterName, float x, float y, float z, float w, boolean shared) Arguments
Particle System Function ReferencesetEmittingStateDescriptionSet whether the particle system should emit new particles Definition function setEmittingState(integer particleSystemId, boolean state) Arguments
resetNumOfEmittedParticlesDescriptionResets the counter of emitted particles. This is used if the maxEmit attribute is set for the particle system. Definition function resetNumOfEmittedParticles(integer particleSystemId) Arguments
Notes since v4.1.5 setParticleSystemTimeScaleDescriptionSets the time scale for the particle simulation. Definition function setParticleSystemTimeScale(integer particleSystemId, float timeScale) Arguments
getEmitterShapeDescriptionReturns the emitter shape of the particle system Definition function getEmitterShape(integer particleSystemId) Arguments
Return Values
setEmitterShapeDescriptionSets the emitter shape of the particle system Definition function setEmitterShape(integer particleSystemId, integer shapeId) Arguments
Physics Function ReferencesimulatePhysicsDescriptionEnable/disable physics simulation Definition function simulatePhysics(boolean state) Arguments
simulatePhysicsTimeScaleDescriptionTime scale of physics simulation Definition function simulatePhysicsTimeScale(float scale) Arguments
createCCTDescriptionCreate character controller (y axis capsule based) Definition function createCCT(integer transformId, float radius, float height, float stepOffset, float slopeLimit, float skinWidth, float collisionMask, float mass) Arguments
Return Values
moveCCTDescriptionEnqueue character movement Definition function moveCCT(integer characterIndex, float x, float y, float z, float collisionMasks) Arguments
removeCCTDescriptionRemove character controller Definition function removeCCT(integer characterIndex) Arguments
getCCTCollisionFlagsDescriptionGet character controller collision flags Definition function getCCTCollisionFlags(integer characterIndex) Arguments
Return Values
raycastAllDescriptionRaycast objects Definition function raycastAll(float x, float y, float z, float nx, float ny, float nz, string raycastFunctionCallback, float maxDistance) Arguments
Return Values
raycastClosestDescriptionRaycast closest object Definition function raycastClosest(float x, float y, float z, float nx, float ny, float nz, string raycastFunctionCallback, float maxDistance) Arguments
Return Values
overlapSphereDescriptionOverlap sphere objects Definition function overlapSphere(float x, float y, float z, float radius, string overlapFunctionCallback, object targetObject) Arguments
Return Values
overlapBoxDescriptionOverlap box objects Definition function overlapBox(float x, float y, float z, float rx, float ry, float rz, float ex, float ey, float ez, string overlapFunctionCallback, object targetObject) Arguments
Return Values
addForceDescriptionAdd force to object Definition function addForce(integer transformId, float forceX, float forceY, float forceZ, float positionX, float positionY, float positionZ, boolean isPositionLocal) Arguments
addImpulseDescriptionAdd impulse to object Definition function addImpulse(integer transformId, float impulseX, float impulseY, float impulseZ, float positionX, float positionY, float positionZ, boolean isPositionLocal) Arguments
setJointDriveDescriptionSet joint drive. Drives orientation if position drive or angular velocity if velocity drive. Definition function setJointDrive(integer transformId, float angle, float valueX, float valueY, float valueZ) Arguments
createWheelShapeDescriptionCreate wheel shape Definition function createWheelShape(integer transformId, float positionX, float positionY, float positionZ, float radius, float suspensionTravel, float spring, float damper, float mass) Arguments
Return Values
setWheelShapePropsDescriptionSet wheel shape properties Definition function setWheelShapeProps(integer transformId, integer wheelShapeIndex, float motorTorque, float brakeTorque, float steerAngle) Arguments
getWheelShapeAxleSpeedDescriptionGet wheel shape axle speed Definition function getWheelShapeAxleSpeed(integer transformId, integer wheelShapeIndex) Arguments
Return Values
getWheelShapeContactPointDescriptionGet wheel shape contact point Definition function getWheelShapeContactPoint(integer transformId, integer wheelShapeIndex) Arguments
Return Values
getWheelShapePositionDescriptionGet wheel shape position Definition function getWheelShapePosition(integer transformId, integer wheelShapeIndex) Arguments
Return Values
addTriggerDescriptionAdds a trigger callback function Definition function addTrigger(integer transformId, string triggerFunctionCallback, object targetObject) Arguments
removeTriggerDescriptionRemoves trigger callback function Definition function removeTrigger(integer transformId) Arguments
addContactReportDescriptionAdds contact report callback function Definition function addContactReport(integer transformId, float forceThreshold, string contactReportFunctionCallback, object targetObject) Arguments
removeContactReportDescriptionRemoves contact report callback function Definition function removeContactReport(integer transformId) Arguments
getRigidBodyTypeDescriptionGet rigid body type Definition function getRigidBodyType(integer transformId) Arguments
Return Values
setRigidBodyTypeDescriptionSet rigid body type Definition function setRigidBodyType(integer transformId, string type) Arguments
getCollisionMaskDescriptionGet collision mask Definition function getCollisionMask(integer transformId) Arguments
Return Values
setCollisionMaskDescriptionSet collision mask Definition function setCollisionMask(integer transformId, integer mask) Arguments
getCenterOfMassDescriptionGet center of mass Definition function getCenterOfMass(integer transformId) Arguments
Return Values
setCenterOfMassDescriptionSet center of mass Definition function setCenterOfMass(integer transformId, float x, float y, float z) Arguments
getMassDescriptionGet mass Definition function getMass(integer transformId) Arguments
Return Values
setMassDescriptionSet mass Definition function setMass(integer transformId, float mass) Arguments
Destruction Function ReferencegetHasDestructionShapeDescriptionReturns if the given destruction shape index exists Definition function getHasDestructionShape(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionShapeWorldTranslationDescriptionGet world translation of the given destruction shape Definition function getDestructionShapeWorldTranslation(integer shapeId, integer destructionShapeIndex, boolean physicalPosition) Arguments
Return Values
destructionShapeLocalToWorldDescriptionDestruction shape local space to world space transformation Definition function destructionShapeLocalToWorld(integer shapeId, integer destructionShapeIndex, boolean physicalPosition, float x, float y, float z) Arguments
Return Values
destructionShapeWorldToLocalDescriptionDestruction shape world space to local space transformation Definition function destructionShapeWorldToLocal(integer shapeId, integer destructionShapeIndex, boolean physicalPosition, float x, float y, float z) Arguments
Return Values
destructionShapeLocalDirectionToWorldDescriptionDestruction shape local space to world space transformation, only direction without translation Definition function destructionShapeLocalDirectionToWorld(integer shapeId, integer destructionShapeIndex, boolean physicalPosition, float x, float y, float z) Arguments
Return Values
destructionShapeWorldDirectionToLocalDescriptionDestruction shape world space to local space transformation, only direction without translation Definition function destructionShapeWorldDirectionToLocal(integer shapeId, integer destructionShapeIndex, boolean physicalPosition, float x, float y, float z) Arguments
Return Values
getDestructionShapeCenterOfMassDescriptionGet the destruction shape center of mass Definition function getDestructionShapeCenterOfMass(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionShapeMassDescriptionGet the destruction shape mass Definition function getDestructionShapeMass(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionShapeLinearVelocityDescriptionGet world space destruction shape linear velocity Definition function getDestructionShapeLinearVelocity(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionShapeAngularVelocityDescriptionGet world space destruction shape angular velocity Definition function getDestructionShapeAngularVelocity(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionMaxDamageDescriptionGet the maximal damage each destruction shape of the shape can receive until it breaks Definition function getDestructionMaxDamage(integer shapeId) Arguments
Return Values
getDestructionShapeDamageDescriptionGet the current damage value of the given destruction shape Definition function getDestructionShapeDamage(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
getDestructionShapeDamageRatioDescriptionGet the current damage ratio [0,1] of the given destruction shape Definition function getDestructionShapeDamageRatio(integer shapeId, integer destructionShapeIndex) Arguments
Return Values
addDestructionShapeDamageDescriptionAdd damage to the given destruction shape Definition function addDestructionShapeDamage(integer shapeId, integer destructionShapeIndex, float damage) Arguments
deleteDestructionShapeDescriptionDelete the given destruction shape Definition function deleteDestructionShape(integer shapeId, integer destructionShapeIndex) Arguments
getNumDestructionJointsDescriptionGet the number of joints the given shape has Definition function getNumDestructionJoints(integer shapeId) Arguments
Return Values
getNumRemainingDestructionJointsDescriptionGet the number of unbroken joints, the given shape currently has Definition function getNumRemainingDestructionJoints(integer shapeId) Arguments
Return Values
addDestructionShapeForceDescriptionAdd force to the given destruction shape Definition function addDestructionShapeForce(integer shapeId, integer destructionShapeIndex, float x, float y, float z) Arguments
addDestructionShapeImpulseDescriptionAdd impulse to the given destruction shape Definition function addDestructionShapeImpulse(integer shapeId, integer destructionShapeIndex, float x, float y, float z) Arguments
Spline Function ReferencegetSplinePositionDescriptionGet spline position Definition function getSplinePosition(integer shapeId, float time) Arguments
Return Values
getSplineOrientationDescriptionGet spline orientation Definition function getSplineOrientation(integer shapeId, float time, float upDirX, float upDirY, float upDirZ) Arguments
Return Values
getSplineLengthDescriptionGet spline length Definition function getSplineLength(integer shapeId) Arguments
Return Values
getSplineNumOfCVDescriptionGet number of spline control vertices Definition function getSplineNumOfCV(integer shapeId) Arguments
Return Values
getSplineCVDescriptionGet spline control vertex Definition function getSplineCV(integer shapeId, float time) Arguments
Return Values
Animation Function ReferencegetAnimCharacterSetDescriptionReturns the character set driving the transform group Definition function getAnimCharacterSet(integer transformId) Arguments
Return Values
enableAnimTrackDescriptionEnable animation track Definition function enableAnimTrack(integer characterSetId, integer track) Arguments
disableAnimTrackDescriptionDisable animation track Definition function disableAnimTrack(string characterSetId, integer track) Arguments
isAnimTrackEnabledDescriptionIs animation track enabled Definition function isAnimTrackEnabled(integer characterSetId, integer track) Arguments
Return Values
setAnimTrackSpeedScaleDescriptionSet animation track speed scale Definition function setAnimTrackSpeedScale(integer characterSetId, integer track, float speedScale) Arguments
setAnimTrackLoopStateDescriptionSet animation track loop state Definition function setAnimTrackLoopState(integer characterSetId, integer track, bool loopState) Arguments
setAnimTrackTimeDescriptionSet animation track time Definition function setAnimTrackTime(integer characterSetId, integer track, float time) Arguments
getAnimTrackTimeDescriptionGet animation track time Definition function getAnimTrackTime(integer characterSetId, integer track) Arguments
Return Values
getAnimClipDurationDescriptionGet the duration of the clip at the given index Definition function getAnimClipDuration(integer characterSetId, integer index) Arguments
Return Values
setAnimTrackBlendWeightDescriptionSet animation track blend weight Definition function setAnimTrackBlendWeight(integer characterSetId, integer track, float weight) Arguments
getAnimTrackBlendWeightDescriptionGet animation track blend weight Definition function getAnimTrackBlendWeight(integer characterSetId, integer track) Arguments
Return Values
getAnimClipIndexDescriptionReturns the index of the clip with the given name Definition function getAnimClipIndex(integer characterSetId, string clipName) Arguments
Return Values
assignAnimTrackClipDescriptionAssign clip to animation track Definition function assignAnimTrackClip(integer characterSetId, integer track, float clipIndex) Arguments
isAnimTrackClipAssignedDescriptionIs clip assigned to animation track Definition function isAnimTrackClipAssigned(integer characterSetId, integer track) Arguments
Return Values
getAnimTrackAssignedClipDescriptionGet animation track assigned clip index number Definition function getAnimTrackAssignedClip(integer characterSetId, integer track) Arguments
Return Values
clearAnimTrackClipDescriptionClear animation track clip assignment Definition function clearAnimTrackClip(integer characterSetId, integer track) Arguments
getAnimNumOfClipsDescriptionGet number of clips Definition function getAnimNumOfClips(integer characterSetId) Arguments
Return Values
Overlays Function ReferencecreateOverlayDescriptionCreate image overlay object Definition function createOverlay(string overlayName, string textureFilename) Arguments
Notes deprecated, use createImageOverlay createImageOverlayDescriptionCreate overlay object Definition function createImageOverlay(string textureFilename) Arguments
Notes since v4.1.3 setOverlayColorDescriptionSet overlay color Definition function setOverlayColor(integer overlayId, float red, float green, float blue, float alpha) Arguments
setOverlayUVsDescriptionSet overlay uv coordinates Definition function setOverlayUVs(integer overlayId, float u0, float v0, float u1, float v1, float u2, float v2, float u3, float v3) Arguments
renderOverlayDescriptionRender overlay Definition function renderOverlay(integer overlayId, float x1, float y1, float width, float height) Arguments
createVideoOverlayDescriptionCreate video overlay object Definition function createVideoOverlay(string videoFilename, bool loopVideo, float soundVolume) Arguments
Notes since v4.1.3 playVideoOverlayDescriptionPlay video overlay object Definition function playVideoOverlay(integer videoOverlayId) Arguments
Notes since v4.1.3 stopVideoOverlayDescriptionStop video overlay object Definition function stopVideoOverlay(integer videoOverlayId) Arguments
Notes since v4.1.3 updateVideoOverlayDescriptionUpdate video overlay object Definition function updateVideoOverlay(integer videoOverlayId) Arguments
Notes since v4.1.3 getVideoOverlayDurationDescriptionGet video overlay duration Definition function getVideoOverlayDuration(integer videoOverlayId) Arguments
Return Values
Notes since v4.1.3 getVideoOverlayCurrentTimeDescriptionGet video overlay current time Definition function getVideoOverlayCurrentTime(integer videoOverlayId) Arguments
Return Values
Notes since v4.1.5 isVideoOverlayPlayingDescriptionGet is video overlay playing Definition function isVideoOverlayPlaying(integer videoOverlayId) Arguments
Return Values
Notes since v4.1.3 Sound Function ReferencecreateSampleDescriptionCreate sample object Definition function createSample(string objectName) Arguments
Return Values
loadSampleDescriptionLoad sample object Definition function loadSample(integer objectId, string sampleFilename, bool b3DSound) Arguments
playSampleDescriptionPlay sample object Definition function playSample(integer objectId, integer loops, float volume, float offset) Arguments
stopSampleDescriptionStop sample object Definition function stopSample(integer objectId) Arguments
setSamplePitchDescriptionSet sample pitch Definition function setSamplePitch(integer objectId, float pitch) Arguments
getSamplePitchDescriptionGet sample pitch Definition function getSamplePitch(integer objectId) Arguments
Return Values
setSampleVolumeDescriptionSet sample volume Definition function setSampleVolume(integer objectId, float volume) Arguments
getSampleVolumeDescriptionGet sample volume Definition function getSampleVolume(integer objectId) Arguments
Return Values
getSampleDurationDescriptionGet sample duration Definition function getSampleDuration(integer objectId) Arguments
Return Values
setSampleVelocityDescriptionSet velocity of a sample object Definition function setSampleVelocity(int sampleId, float x, float y, float z) Arguments
getSampleVelocityDescriptionGet velocity of a sample object Definition function getSampleVelocity(integer sampleId) Arguments
Return Values
enableSampleFXDescriptionenable audio effects - Reverberation Definition function enableSampleFX(integer objectId, int reverbPresetType) Arguments
disableSampleFXDescriptiondisable audio effects - Reverberation Definition function disableSampleFX(integer objectId) Arguments
enableSampleFilterDescriptionenable audio filters Definition function enableSampleFilter(integer objectId, int filterType, float gain, float gainLF, float gainHF) Arguments
disableSampleFilterDescriptiondisable audio filter Definition function disableSampleFilter(integer objectId) Arguments
createStreamedSampleDescriptionCreate streamed sample object Definition function createStreamedSample(string objectName) Arguments
Return Values
loadStreamedSampleDescriptionLoad streamed sample object Definition function loadStreamedSample(integer objectId, string bgmusicFilename) Arguments
playStreamedSampleDescriptionPlay streamed sample music object Definition function playStreamedSample(integer objectId, integer repeat) Arguments
pauseStreamedSampleDescriptionPause streamed sample object Definition function pauseStreamedSample(integer objectId) Arguments
resumeStreamedSampleDescriptionResume streamed sample Definition function resumeStreamedSample(integer objectId Arguments
stopStreamedSampleDescriptionStop streamed sample object Definition function stopStreamedSample(integer objectId Arguments
setStreamedSampleVolumeDescriptionSet streamed sample volume Definition function setStreamedSampleVolume(integer objectId, float volume) Arguments
getStreamedSampleVolumeDescriptionGet streamed sample volume Definition function getStreamedSampleVolume(integer objectId) Arguments
Return Values
createAudioSourceDescriptionCreate audio source object for 3D sounds Definition function createAudioSource(string audioSourceName, string sampleFilename, float radius, float innerRadius, float volume, integer loops) Arguments
getAudioSourceSampleDescriptionGets the sample id of an audio source Definition function getAudioSourceSample(integer objectId) Arguments
Return Values
Input Function ReferencegetNumOfGamepadsDescriptionGet number of joysticks/gampads Definition function getNumOfGamepads() Return Values
Notes since v4.1.5 getInputAxisDescriptionGet joystick/gampad axis value Definition function getInputAxis(integer axisNumber, integer gamepadIndex) Arguments
Return Values
getInputButtonDescriptionGet joystick/gampad button value Definition function getInputButton(integer buttonNumber, integer gamepadIndex) Arguments
Return Values
keyEvent and mouseEvent callbacksXML Function ReferenceXML PathXML paths used in the getXML... and setXML... functions have the following format: createXMLFileDescriptionCreate an empty XML file Definition function createXMLFile(string objectName, string filename, string rootNodeName) Arguments
Return Values
loadXMLFileDescriptionLoad XML file Definition function loadXMLFile(string objectName, string filename) Arguments
Return Values
saveXMLFileDescriptionSave XML file Definition function saveXMLFile(integer objectId) Arguments
getXMLIntDescriptionGet XML file integer attribute Definition function getXMLInt(integer objectId, string attributePath) Arguments
Return Values
getXMLFloatDescriptionGet XML file float attribute Definition function getXMLFloat(integer objectId, string attributePath) Arguments
Return Values
getXMLBoolDescriptionGet XML file boolean attribute Definition function getXMLBool(integer objectId, string attributePath) Arguments
Return Values
getXMLStringDescriptionGet XML file string attribute Definition function getXMLString(integer objectId, string attributePath) Arguments
Return Values
setXMLIntDescriptionSet XML file integer attribute Definition function setXMLInt(integer objectId, string attributePath, integer value) Arguments
setXMLFloatDescriptionSet XML file float attribute Definition function setXMLFloat(integer objectId, string attributePath, float value) Arguments
setXMLBoolDescriptionSet XML file boolean attribute Definition function setXMLBool(integer objectId, string attributePath, boolean value) Arguments
setXMLStringDescriptionSet XML file string attribute Definition function setXMLString(integer objectId, string attributePath, string value) Arguments
hasXMLPropertyDescriptionReturns if an XML path is available in the file Definition function hasXMLProperty(integer objectId, string propertyPath) Arguments
Return Values
Network Function ReferencenetStartupDescriptionStartup network subsystem Definition function netStartup(integer maxConnections, integer threadSleepTimer, string localHostAddress, integer port, string packetReceivedCallback, object targetObject) Arguments
Return Values
netSetMaximumIncomingConnectionsDescriptionSet maximum incoming connections Definition function netSetMaximumIncomingConnections(integer maximumIncomingConnections) Arguments
netSetIncomingPasswordDescriptionSet incoming password Definition function netSetIncomingPassword(string incomingPassword) Arguments
netConnectDescriptionConnect Definition function netConnect(string host, integer port, string password) Arguments
Return Values
netCloseConnectionDescriptionClose network connection Definition function netCloseConnection(integer streamId, boolean sendDisconnectionNotification, integer orderingChannel) Arguments
netShutdownDescriptionNetwork shutdown Definition function netShutdown(integer maxBlockDurationTime, integer orderingChannel) Arguments
netSendStreamDescriptionNetwork send stream Definition function netSendStream(integer streamId, string priority, string reliability, integer orderingChannel, boolean flushStream) Arguments
streamWriteBoolDescriptionStream write boolean Definition function streamWriteBool(integer streamId, boolean value) Arguments
streamWriteInt8DescriptionStream write 8bit sigend integer Definition function streamWriteInt8(integer value) Arguments
streamWriteInt16DescriptionStream write 16bit signed integer Definition function streamWriteInt16(integer value) Arguments
streamWriteInt32DescriptionStream write 32bit signed integer Definition function streamWriteInt32(integer value) Arguments
streamWriteIntNDescriptionStream write N bit signed integer. 0>N>32. Definition function streamWriteIntN(integer value) Arguments
streamWriteFloat32DescriptionStream write 32bit float Definition function streamWriteFloat32(float value) Arguments
streamWriteStringDescriptionStream write string Definition function streamWriteString(string value) Arguments
streamReadBoolDescriptionStream read boolean Definition function streamReadBool(integer streamId) Arguments
Return Values
streamReadInt8DescriptionStream read 8bit signed integer Definition function streamReadInt8(integer streamId) Arguments
Return Values
streamReadInt16DescriptionStream read 16bit signed integer Definition function streamReadInt16(integer streamId) Arguments
Return Values
streamReadInt32DescriptionStream read 32bit signed integer Definition function streamReadInt32(integer streamId) Arguments
Return Values
streamReadIntNDescriptionStream read N bit signed integer Definition function streamReadIntN(integer streamId) Arguments
Return Values
streamReadFloat32DescriptionStream read 32bit float Definition function streamReadFloat32(integer streamId) Arguments
Return Values
streamReadStringDescriptionStream read string Definition function streamReadString(integer streamId) Arguments
Return Values
streamGetNumOfUnreadBitsDescriptionStream get number of unread bits Definition function streamGetNumOfUnreadBits(integer streamId) Arguments
Return Values
streamGetReadOffsetDescriptionStream get read offset Definition function streamGetReadOffset(integer streamId) Arguments
Return Values
streamSetReadOffsetDescriptionSets the read pointer to the given offset in bytes Definition function streamSetReadOffset(integer streamId, integer offset) Arguments
streamGetWriteOffsetDescriptionReturns the write pointer offset in bytes Definition function streamGetWriteOffset(integer streamId) Arguments
Return Values
streamSetWriteOffsetDescriptionSets the write pointer to the given offset in bytes Definition function streamSetWriteOffset(integer streamId, integer offset) Arguments
Network definesDescriptionNetwork message types Definition
Callbacks Function ReferenceDefault callbacksinitDescriptionThis function is called once on startup. Create and load objects here. Definition function init(string args) Arguments
Return Values
keyEventDescriptionThis function is called when a key event occurs. Definition function keyEvent(float unicode, float sym, float modifier, boolean isDown) Arguments
mouseEventDescriptionThis function is called when a mouse event occurs. Definition function mouseEvent(float posX, float posY, boolean isDown, boolean isUp, float button) Arguments
updateDescriptionThis function is called once per frame to update game state. Definition function update(float dt) Arguments
drawDescriptionThis function is called once per frame to draw game objects. Call render functions here. Definition function draw() Custom callbackstrigger callbackDescriptionThis function is called when a trigger event occurs. Definition function triggerFunctionName(integer triggerId, string otherId, boolean onEnter, boolean onLeave, boolean onStay) Arguments
contact callbackDescriptionThis function is called when a contact event occurs. Definition function onContact(integer objectId, integer otherObjectId, boolean isStart, float normalForce, float tangentialForce) Arguments
raycast callbackDescriptionThis function is called when a raycast hit event occurs. Definition function raycastFunctionName(integer hitObjectId, float x, float y, float z, float distance) Arguments
Return Values
create callbackDescriptionCreate callbacks are called during i3d loads. Definition function createFunctionName(integer objectId) Arguments
timer callbackDescriptionThis function is called when a timer event occurs. Definition function timerFunctionName() Return Values
packet received callbackDescriptionThis function is called when a network packet was received. Definition function packetReceived(packetType, timestamp, streamId) Arguments
Foundation ReferenceScenegraphtranslateDescriptionTranslate object (transform) Definition function translate(integer objectId, float dx, float dy, float dz) Arguments
Source file shared/foundation/scenegraph.lua rotateDescriptionRotate object (transform) Definition function rotate(integer objectId, float dx, float dy, float dz) Arguments
Source file shared/foundation/scenegraph.lua toggleVisibilityDescriptionToggle visibility of a scenegraph object Definition function toggleVisibility(integer objectId) Arguments
Source file shared/foundation/scenegraph.lua printScenegraphDescriptionPrints scenegraph object Definition function printScenegraph(integer objectId) Arguments
Source file shared/foundation/scenegraph.lua InputKey valuesDescriptionKey values used by keyEvent function Definition
Source file shared/foundation/input.lua Mouse valuesDescriptionMouse values used by mouseEvent function Definition
Source file shared/foundation/input.lua Gamepad/Joystick valuesDescriptionGamepad/Joystick axis values used by getInputAxis function Definition
Source file shared/foundation/input.lua Reverberation Preset valuesDescriptionReverberation preset values used by enableSampleFX function Definition
Source file shared/foundation/audio.lua Filter typesDescriptionFilter types values used by enableSampleFilter function Definition
Source file shared/foundation/audio.lua TutorialsTutorial 1 – Load i3d files and basicsThe goal of this tutorial is to teach you the very basics of the GIANTS engine. You simply load an i3d with a cube in it and then rotate the cube by using LUA script. Sample name: SampleI3DLoading Script source code file: sample/i3dLoading/main.lua The goal of this tutorial is to show you
init() keyEvent() update() rotate() getRootNode() loadI3DFile() link() getChildAt() print() requestExit() The most important script file is your main.lua. It is a lua file that is loaded and executed when your exe file is started. The first thing you need to know is how the engine exactly knows where your main.lua is. Well there has to be an xml file in the same folder as your exe with exactly the same name as your exe. In this case it is named SampleI3DLoading.xml. Open it with a text editor.
In the third line you see where your main.lua is located. If you want to move your main.lua, you have to change the path in this xml as well. So, let's have a look at this main.lua, open it with any text editor. There are 5 essential functions: init(), mouseEvent(), keyEvent(), update() and draw(). Let's look at these functions in detail: init()init() is executed once when you start your exe. Let’s go through the function line by line: local worldRootNode = getRootNode(); The variable worldRootNode is defined and assigned with the result of a function called getRootNode(); If you meet a new function and you don’t exactly know what it does, simply look here and search for the function. Then you get detailed information about the function. In the tutorials those function descriptions are always blue. Here is what you find if you search for the getRootNode function: getRootNodeDescriptionGet scenegraph root node Definition function getRootNode() Return Values
The descriptions of the functions are quite self-explanatory and can be really helpful. It's important to see that the GIANTS engine works with ids also called handles. This function returns the id from the root node of your root scene graph. Your entire world is attached to this root node. Each object you want to see later on must be a child of this root node. Now we need to load the i3d that contains the cube we want to rotate later on. local sceneToLoad = loadI3DFile("sample/i3dLoading/cube.i3d"); With this function, you load an i3d file, and its id (which is an integer) is returned. Now that we’ve got both things, the worldRootNode and the i3d we want to load, we have to link them together, which is the next line of code. link(getRootNode(), sceneToLoad); Now we want the cube's id to rotate. Be aware that the i3d we've already loaded is the whole scene which contains not only the cube, but also a light and the camera. So now we need to know which id the cube has. Since the cube is a child of the i3d we can use the following function: cubeId = getChildAt(sceneToLoad, 0); First you name the i3d that you want the child from and then you say which child you want. 0 is the first child, 1 is the second. You need to know which child is your cube. Just open the cube .i3d with the Editor and you can see that the cube is the first position in your scenegraph (reading from top down) A very important thing you need in programming are prints. The function needed here is simply called print(). The thing you want to print are the parameters. Be careful with strings, they always need quotes. You can link strings and variables by using .. as shown in the example. print("this is a print: cube id: " .. cubeId); You can see the printed text in the in game console. Just press tilde '~' to make the console visible. Now we have all the information we need, but one thing remains to be done. Since the camera is located right in the center (inside the cube actually) we won’t be able to see anything. So we grab the camera and move it a bit. With the getCamera() function we first get the id of the camera, because the setTranslation function needs to know which id has to be translated. The next parameters are the desired x, y, z values. setTranslation(getCamera(), 5, 10.0, 10.0); Then we rotate the camera so that we can see our cube nicely. The function is similar to the setTranslation but you define the rotations around the three axes of course. You need a radian value, that’s why the functions math.rad() are used. They convert a degree value into a radian value. setRotation(getCamera(), math.rad(-45), math.rad(20), 0); mouseEvent()We don’t use this function right now, but of course you can access the mouse commands with it.
keyEvent()This function is used to access any keyboard commands. In this case, we only want to know if the escape key is pressed. If this is the case, then the program closes with the command requestExit();
update(dt)The update function is a function that is called after every frame. The parameter dt is the time that has passed since the last update call in milliseconds.So, this is the place where we can finally make our cube rotate. For this we use the rotate(dt) function. It needs the id of the object that should rotate, in this case the cubeId, and also the rate of rotation on the x, y and z-axis. We just let it rotate on the x-axis with the value of 0.08 degree per millisecond.
draw()The draw function is needed to draw something onto the screen. This will be discussed later on.
Tutorial 2 – Light functions, global time and rendering textSample name: SampleLighting Script source code file: sample/lighting/main.lua The goal of this tutorial is to show you
setLightDiffuseColor() getLightDiffuseColor() setLightRange() getLightRange() renderText() The first thing you might notice is that there are two new additional variables that we’re going to use: local globalTime = 0; local lightRadius = 7; In this, and also in further tutorials, we will just cover the new functions and variables. So, if there is anything you don’t understand, have a look at Tutorial 1. init()In the init() function we additionally store the id of the point light in the variable pointLightId.pointLightId = getChildAt(id, 2); When you open the i3d file cubeWithPointLight.i3d, you can see that the light is in third position. Since the function getChildAt()starts counting from 0, the argument 2 points to the third child. Set the light radius to an initial value of 7. setLightRange(pointLightId, lightRadius); keyEvent()Here are two more keys: Key 1 and Key 2. When they are pressed, the functions decreaseLightRadius and increaseLightRadius are called.
increase- decreaseLightRadius() These two functions change the variable lightRadius by 0.5 and then call the lightRadius function with the new value.
update(dt)Two variables are new here:Why do we need a globalTime here? Well, we want the light to rotate around the cube. Therefore, we need a value that constantly changes in corrrespondence with time. Of course you could also increase a number every frame, but since the framerate isn’t constant we also use the time which has passed since the last frame and thus get an exact and constantly growing number that isn’t affected by the different framerates. Remember that dt is the time passed between the last and the actual frame in milliseconds. So, if dt is multiplied by 0.001 you get seconds. We also need a distance to the center which is stored in the variable radius. globalTime = globalTime+dt*0.001; local radius = 2; This function handles the translation of the pointLight using the globalTime and the radius 2. setTranslation(pointLightId, math.sin(globalTime)*radius, 3, math.cos(globalTime)*radius); We also change the color of the diffuse color of the light. This is done with the setLightDiffuseColor() function. As arguments it uses the id, and then the three values for red, green and blue as floats between 0 and 1. As r we use the sinus of the globalTime. setLightDiffuseColor(pointLightId, math.sin(globalTime), 0.4, 0.2); When you execute the program, you see that there is a white box where the point light is. This may seem a bit odd since you probably don’t want this cube to be visible at all. When you open the file cubeWithPointLight.i3d and click on the plus left of the light in the scene graph, you see that we have attached a little cube to the light. We have done this to to give you a better visual feedback on where the pointLight is. On top of that, it shows also another important thing: as a child it inherits the translations of the parent and thus also moves with it. draw()Like the update function, the draw function is executed after every frame.First we store the rgb values of the pointLight using the getLightDiffuseColor() function. It returns three different values. So be careful, you need to separate the different variables by commas! local r, g, b = getLightDiffuseColor(pointLightId); Then we use the function renderText() to render the result directly onto the screen. renderTextDescriptionRender text to viewport Definition function renderText(float x, float y, float size, string str) Arguments
When using renderText you can also weld parts together with the .. operator to concatenate variables and strings like in the example. renderText(0,0.95,0.05,"r value: " .. r); renderText(0,0.90,0.05,"g value: " .. g); renderText(0,0.85,0.05,"b value: " .. b); The next line stores the value of the getLightRange() function in the lightRadius variable local lightRadius = getLightRange(pointLightId); and then the variable is rendered onto the screen: renderText(0,0.75,0.05,"LightRadius: " .. lightRadius); With the last line we simply render the globalTime. Since it is a float we use math.floor to get an integer. renderText(0,0.65,0.05,"seconds: " .. math.floor(globalTime)); Tutorial 3 - User AttributesSample name: SampleUserAttributes Script source code file: sample/userAttributes/main.lua The goal of this tutorial is to show you
getUserAttribute() setUserAttribute() setScale() translate() Open sceneWithUserAttributes.i3d and main.lua which are located in \sample\userAttributes. Run the sample SampleUserAttributes.exe. You see three cubes with different scales and one cube that is rotating. If you press 1,2 or 3, the related cube is translated onto the y-axis and the number of translations is also displayed. If you look at sceneWithUserAttributes.i3d in the editor, you will see, that all three cubes in the back have the same size. Open the User Attributes window. ![]() In the User Attributes window you see the name of your object, followed by the user attributes and at the bottom there is the possibility to create new attributes. Select the different objects to see what kind of user attributes they have. You’ll notice that both cubes in the back have two user attributes labeled count and size. The bigger cube in the front only has an onCreate script callback. How to create new user attributes To create your own attributes, just enter the name of your attribute and then choose the according type of your attribute. You can choose whether your attribute is a boolean, integer, float, a string or a script callback. Then hit add and your attribute will appear. Let’s have a look at the LUA code in main.lua. The very first line of code is the creation of an empty array called cubeIdArray. init()You should be familiar with the first two lines, otherwise have a look at Tutorial 1. What follows is a for loop from 0 to 2 where the array cubeIdArray is filled up with three new arrays containing the cubeIds of the three cubes. Then the variable size gets filled with the result of the getUserAttributes function. The getUserAttributes function needs the id of the object and the name of the attribute as arguments. Be careful here, the name has to be exactly the same as you have specified in the editor. Finally, there is a check whether size has a value and then the function setScale is used to scale the cube accordingly. Try to enter new size values in the i3d and then see the result by running the program.
keyEvent()First we check if esc is pressed. Then, if the keys 1,2 or 3 are pressed, the rest of the code is executed. The id of the corresponding cube is stored within the variable cubeId. Then the count of the cube is stored in the variable count by using the return value of the function getUserAttribute. If the count isn’t nil, the count is increased by one using the setUserAttribute function. The setUserAttribute function can either be used to create new attributes or to overwrite values of existing attributes. It uses the id of the object (cubeId), the name of the attribute("count"), the data type(Integer) and the new value as arguments(count+1). Finally, the corresponding cube is translated onto the y-axis with the value 0.1 using the translate function.
cubeOnCreate(id)This function isn't called anywhere in the LUA code. So what is it used for? As soon as the cube in the front gets loaded, its attribute script callback causes the function cubeOnCreate to run once. The script also provides the id of the object that caused the script callback. Be careful with the spelling, the function in your LUA script has to be exactly the same as your ScriptCallback in the i3d. What we do in the cubeOnCreate function is quite simple: we store the id in the new variable rotatingCubeId.
update(dt)Here we first check if rotatingCubeId exists and then we rotate the cube using the rotate function with the id we stored in the variable rotatingCubeId.
draw()Here you can see how flexibly you can use the renderText function: using it within a for loop, for welding text and variables as well as for calling functions like the getUserAttributes in this case.
Tutorial 4 - TimersSample name: SampleTimer Script source code file: sample/timer/main.lua The goal of this tutorial is to show you
addTimer() setTimerTime() removeTimer() Run the sample SampleTimer.exe. Only three lines of text are rendered. The first shows you a random timer interval, the second is a string that says that you can remove the timer with the space key and finally, there is a line showing a flashing text :"Timer called". Before we start looking at the code we should get a rough idea about what a timer is, and what functionalities it has. A timer is a simple object that has a certain set time and the name of the callback function. As soon as the timer is activated, the defined time is counted down to zero. When this happens, the timer calls the callback function. This behavior can be used in various situations, for instance if a trigger shouldn’t react immediately but only after a certain delay. Open the the main.lua which is located in the directory /sample/timer. At first, four variables are defined:
init()In the init function the first line calls the function setRandomTimerInterval. This function simply generates a random value between 1000 and 5000 for the variable timerInterval.
The variable timerInterval is used immediately because a new timer is created with the line: timerId = addTimer(timerInterval, "onTimer"); The variable timerId stores the Id of the new timer which is returned by the function addTimer. Here is how this function is described in the documentation: addTimerDescriptionAdds timer callback function Definition function addTimer(float time, string timerFunctionCallback, object instance) Arguments
Return Values
The first argument is the time in milliseconds and the second argument is the function that is called when the time reaches zero. In this case, the variable timerInterval defines how long the timer will wait, until it calls its callback function. After this time, the function onTimer is called. keyEvent()If you hit the space key the timer is removed and the boolean timerRemoved is switched to true.
onTimer()This function is called as soon as the timer reaches zero. The first line defines the variable renderCount to be 100. This defines the number of frames the line "timer called" is rendered in the draw function later on. The second line defines a new timerInterval by calling the setRandomTimerInterval function again. The third line sets a new timer time with the new timerInterval time. The setTimerTime function needs the id of the timer (timerId) and the new time (timerInterval). After the timer reaches zero again, the onTimer function is called again. You can remove a timer within the callback function by returning false.
draw()First we have an if-else construct that handles the two states, i.e. whether the timer is removed or not. Depending on the state of the boolean timerRemoved, the different renderText functions are executed. The string "timer called" is only called if the variable renderCount is not zero. Remember that we set the renderCount to 100 in the onTimer function which is the trigger callback of the timer. With each frame the renderCount is decreased by 1. Tutorial 5 - PhysicsSample name: SamplePhysics Script source code file: sample/physics/main.lua The goal of this tutorial is to show you
Basically, there are two different types of objects available. Objects with rigid body and objects without rigid body. No rigid bodyObjects with no rigid body are only rendered. They can be moved freely and they don’t cause any collision, thus other objects can move through them. These objects only use a minimum of the engine's performance. If you export a new object from Maya without having changed the attributes, the rigid body is activated by default. You should turn it off in the editor, when you don’t need it. Rigid bodyObjects with rigid body behave like real objects. If another object with rigid body tries to go trough it, there will be a collosion. Since the used up power of this behavior has to be calculated, it should only be used when necessary. There are three rigid body types: StaticThese objects offer collision, but they can’t be moved, nor do they react to gravity.KinematicThese objects offer collisions with dynamic objects and can be moved in a predefined way. E.g. if you have a train that goes from A to B along a predefined path and a collision occurs with a kinematic object, the train will simply continue its movement, while the dynamic object will be pushed away. If the same train hits a static or another kinematic object, nothing will happen.DynamicThis kind of objects react dynamically to collisions and can't be moved manually. The movement of dynamic objects is a result of external forces and isn’t predefined.Run SamplePhysics.exe. Since it is self-explanatory, just open the sceneWithPhysics.i3d which is located in /sample/physics to see how it is done. ![]() You probably need to zoom out a bit to see the whole scene. Select the different objects and look at the Rigid Body Type in the red marked area. In this scene all objects are rigid bodies, but the Rigid Body Type is different, depending on how their physics should react. If you want to select a cube which is within the sphere of the multi-selection-tool, you’ll first have to select something that is a bit further away. Try to change the Rigid Body Type of the different objects and see what happens, when you run the program. To change it, simply open the dropdown menu and select the desired Rigid Body Type. Hit enter, and don’t forget to save your scene. Instead of defining the physical behavior of an object in the editor, you could specify these settings directly in Maya. Launch the i3d exporter and open the attributes panel where you can see all the Rigid Body options available. Just select the desired mesh, click Load Current and then set the Rigid Body settings as you wish. Don’t forget to click Save Current when you've done it. If you export the mesh as an i3d file, the rigid body settings are already included. This method has the advantage that attributes defined in Maya remain in the saved scene file. If you export the same scene more than once, you might save time by defining it once in Maya instead of redoing it every time in the editor. ![]() Tutorial 6 - OverlaysSample name: SampleOverlay Script source code file: sample/overlay/main.lua The goal of this tutorial is to show you
createOverlay() setOverlayColor() renderOverlay() When you run sampleOverlay.exe you see an overlay displayed on the screen. If you click on it, its position changes randomly. Open main.lua which is in /sample/overlay to take a look at the code. First there are three variables: overlayId holds the id of the overlay, overlayX and overlayY are used to define the position of the overlay. init()In the first line, the variable overlayId is filled with the result of the function createOverlay which returns the id of the newly created overlay. The documentation describes the createOverlay functions as follows: createOverlayDescriptionCreate overlay object Definition function createOverlay(string overlayName, string textureFilename) Arguments
Take note that you have to use the relative path to your file. overlayId = createOverlay("overlay", "sample/overlay/overlay.png"); The second line consists of the setOverlayColor function. Try to comment it out by adding -- in front of the line. Save the script and run the program. You see that this sample also works without the setOverlayColor function. It isn’t needed to display an overlay, but it gives you the possibility to change its appearance. Here is how it is described in the documentation: setOverlayColorDescriptionSet overlay color Definition function setOverlayColor(integer overlayId, float red, float green, float blue, float alpha) Arguments
The used arguments in the example result in white with an opacity of 0.75. setOverlayColor(overlayId, 1, 1, 1, 0.75); Try the arguments 1, 0, 0, 0.75, to see the difference. mouseEvent()This function runs every time you move the mouse or click on it. If the mouse is inactive this function isn’t executed. It provides the position of the cursor, and the state of the buttons which can be used within the function. We first check, if the state of a mouse button is down, which is done by the isDown part of the if-construct. The rest of the if-construct is a simple hit test, it checks whether the cursor is within the overlay or not. If the if-construct returns true, you have clicked on the button. Then the overlayX and overlayY values are overwritten with a random number between 0.05 and 0.8.
draw()What happens here is essential : try commenting out the renderOverlay function once. If you run the sample now, nothing will be rendered at all. This function is needed to render an overlay. This allows you to display or hide components (e.g. menu options) depending on the state of your program. Here is how the function is described in the documentation: renderOverlayDescriptionRender overlay Definition function renderOverlay(integer overlayId, float x1, float y1, float width, float height) Arguments
A width and height of 1 means that the overlay has exactly the size of the screen. Since overlayX and overlayY change when you click on the overlay, it is instantly rendered in the new position.
Tutorial 7 - AudioSample name: SampleAudio Script source code file: sample/audio/main.lua The goal of this tutorial is to show you
createSample() loadSample() playSample() Run sampleAudio.exe. Every two seconds you should hear a "pling" and if you press space you should hear a water splash. Open main.lua which is in /sample/audio to see the code of this example. First there are three variables: time, sample1Id and sample2Id init()The first line creates a sample using the createSample function and stores the id in the variable sample1Id. The only argument here is the name of the sample. sample1Id = createSample("sample1"); The sample is like an empty shell which needs filling with an audio file. That’s what the second line does. It needs the id of the sample and the filename as arguments. The last argument is a boolean and defines whether your sound is 3D or not. 3D sounds can be placed in your scene. They are surrounded by a sphere which defines the distance over which the sound can be heard. The closer you get to the sound the louder it is. A 2D sound simply plays at full volume when it is triggered. For the filename you need to indicate the relative path. loadSample(sample1Id, "sample/audio/sample1.wav", false); keyEvent()If you press the space key, the sample2 is played via the playSample function. Here is how this function is described in the documentation: playSampleDescriptionPlay sample object Definition function playSample(integer objectId, integer loops, float volume, float offset) Arguments
The offset defines from which position within the sample it starts playing. E.g. if you define an offset of 3000, the first three seconds of your sample are cut off the first time the sample gets played.
update()First the time is increased and if it is larger than 2000 milliseconds the sample1 is played and the time is reset to 0.
Editor
![]() If you start up the Editor, you might not have all the panel windows open. To open other panel windows open the menu option window and enable the panel you want. You can adjust the width and height of the panels by dragging the outlines and if you want to close a window you can simply press the cross right of the panel name. Viewport![]() NavigationThe navigation is quite like in Maya. If you have nothing open in your editor I suggest you quickly open a simple i3d file otherwise you won’t see much of an effect. If its to dark in your scene just create a light by going to Create–>Light.Some shortcuts: LMB = Left Mouse Button RMB = Right Mouse Button MMB = Middle Mouse Button Alt + LMB = Press and hold the Alt-Key and the left mouse button. Alt + LMB is rotating the camera. Alt + RMB moves the camera forward and backward. Alt + MMB causes the camera to pan. If you don’t have a middle mouse button, you can press LMB and RMB instead. View OptionsBy simply right-clicking into the viewport panel you get the View Options. Sometimes it’s useful too use different cameras in a scene. You can create them once and then with the View Options you can choose the camera to view at your scene from different angles quickly.You might notice that if you rotate, the camera is rotated. If you have a big level this behaviour is very useful, but if you want to look at one particular object this can be quite awkward. To change the rotation to Framed Rotate you first have to select your object either by clicking on it directly or by choosing it from the scene-graph and the framing the selected object by pressing the F key. Now you can simply click (RMB) on the screen to open the View Options and choose Framed Rotate. Now the camera is rotating around your the last framed object. With solid or wireframe you can choose if you want the view shaded. If you have large scenes, you can toggle the visibility of lights, audio sources, physics and the cameras by checking them on the show submenu. You can also use the Selectable submenu to toggle whether you can select lights, audio sources or cameras. Furthermore you can toggle the grid and the polycount on and off. Scenegraph PanelA very useful feature of the GIANTS Editor is the scenegraph. If you don’t have it on the screen, just go to menu window and hit scenegraph. It is basically the same you have in Maya. It shows all objects you have in your scene and also the parent-child relationship between your objects.![]() Let’s just make a little scene with some Transform Groups. The Transform Group is the basic building block of your scene. You can use a TransformGroup to move all the attached objects just by moving the Transform Group since the children inherit the transformations of the parent. To create a new Transform Group go to Create and hit TransformGroup. Now you can see it in the Scenegraph, its name is transform. To change the name just select it and go to the attributes panel. At the very top of the panel you can choose the name of your object. Make two TransformGroups and name them Parent and Child. If you move them around you see that their transformations are independent, the movement of the parent doesn’t affect the child. Now let’s make the appropriate relationship between the two. Select the child in the scenegraph panel and go to Edit->Cut. Now select your parent and hit Edit->Paste. As you can see now, the child is now connected to the parent. If you now move around the parent, the transformation of the child is affected too whereas the child can be moved around without affecting the parent. ![]() There can be 6 types of objects in your scene: Triangle Meshes, Splines, Cameras, Transform Groups, Lights, Terrains and Audio Sources. It is also possible to use CTRL+C to copy objets, CTRL+X to cut objects and CTRL+V to paste objects. Notice that pasted objects are always children of the currently selected object. If you want to paste an object on the highest hierarchy level of the scenegraph be sure that nothing is selected in the scenegraph. This can be achieved by clicking at an empty space in the scenegraph panel. Attributes PanelIf you don’t see the attributes panel go to Windows->Attributes then select an object in the scenegraph or the viewport. One important thing to notice is, that if the background color of an attribute turns red, you entered a value that isn’t allowed. (eg scale values other than 1 for a dynamic rigid body object) The background color of animated attributes is yellow.![]() Toolbar![]() The toolbar looks like this. If your pointing on the icons with your mouse, a text with the functionality of the tool is displayed. Let’s quickly go through them from left to right. File Operations
Toggle Local- World Mode A handy tool is the toggle Local- World Mode, it changes the orientation of the viewport transform gizmo from the local space of your object to world space. Grid Snapping (4.1.5 or later) Use this option to snap objects to a predefined grid. Terrain and Terrain Foliage
Terrain Editing![]() To test the terrain sculpting, just open the terrain test scene. Now you have a terrain to play with. Open the terrain editing panel with window->Terrain Editing. (If the scenegraph panel is still open it might cut off a bit, just close it to get more space.) ![]() If the terrain sculpt mode is active now, you can rise or lower the surface of your terrain by using RMB and LMB. MMB can be used to smooth and the value defines the force with which you pull or push. What happens here is, that you are painting a height map, that defines the height of each point of your terrain by giving it a grey-value. The attributes Opacity, Hardness and the Value are defining the “brush” you are painting the height map with. Just play around with the setting.With the shortcuts "V" and "B" you can change size of the brush and with "N" and "M" you can change the opacity of the brush quickly. In the terrain texture paint mode next to the terrain sculpt icon you can colorize your terrain with different textures. The used texture layers are defined in the i3d-file. (If you want to change the texture layers, you have to open the i3d with a text editor and change the layers there) Just choose your texture and paint onto your terrain. With the Chunk vis checkbox on, you can see exactly which texture layers you used in a chunk by what amout. You can use as many texture layers as you want, but you are limited to a maximum of four texture layers per chunk. With the Terrain Foliage Paint Mode active, you can paint your foliage onto your terrain, it`s the same thing as if you would paint onto your terrain - not with a texture but with foliage. LMB adds foliage, RMB removes foliage. User Attributes![]() The user attributes panel is typically not visible if you open the editor for the first time. So go to Windows->User Attributes. Select an object in the scenegraph to see its user attributes. User Attributes can be defined in the editor and then be used in the engine (eg. within a script). This enables you to define object specific attributes for every object in the scene. Animation Panel (4.1.5 or later)![]() You can preview animation sets with the animation panel. Particle System Panel (4.1.5 or later)![]() The particle system panel allows you to edit particle systems with real time preview. Spline Editing (4.1.5 or later)![]() You can edit splines by picking a control vertex (CV) of a spline an moving it around. Delete or insert new control vertices with the keys delete and insert. ScriptingHere you can execute script snippets. With ENTER, you can add new lines. SHIFT+ENTER will execute the code in the text field.Type in the following:
Then hit SHIFT+ENTER and the string is printed out above. The scripting can be useful for many things. For example you can run this script snippet to test the fog settings in an i3d scene:
Replace Dialog![]() If you want to replace an object in your scene, you can go to Edit->Replace to open the replace panel. Select the object you want to replace, then hit load. Do likewise with the object you want to replace with and choose whether you want to keep the User Attributes or not. Now you can replace one single object by hitting replace or you can replace all objects that are similar to the one you selected by hitting replace all. Note: replace all does only work with single objects, but not with hierarchies of objects, however the single replace function works. This feature is quite useful because you can use it to substitute an object reference feature within your i3d scene file. Interactive PlacementThis is a really nice feature of the editor, so you should try it at least once!To place an object on the surface of another object, you can simply select the object you want to place and then press CTRL + B + LMB, while pointing at your desired location. The selected object will then instantly be set to the location you’ve chosen. Hint: you can do this with all your objects within your scenegraph and also with the camera or light sources. E.g. you can select the current camera and then place the camera at a location far away, allowing for fast relocation of the camera. If you keep the LMB pressed and hit CRTL or SHIFT you can clone the selected object at the currect mouse position. CRTL will just clone the object while SHIFT will add a random rotation in the y-axis. (Very useful feature if you want to create a forest with hundreds of randomly rotated trees for instance) Other functionalityEdit->Clear History: This clears the undo/redo history. Edit->Move to Camera: Moves the selected object in front of the current camera Navigation Speed: Moves the camera faster or slower. Use - and + to ajust the speed. Keyboard short-cuts
Debugger![]() OverviewThe debugger lets you test and run your scripts by setting break points inside your code and analyzing the situation once reaching them. With its help you can avoid adding custom debug print calls to check for the assignment of variables or if a certain part of the code got reached. It is easy to use and follows known conventions for debugging environments.The user interface is divided in the following sections:
You can move around each panel by dragging and dropping the corresponding title bar. You can resize the panel by pulling its borders. You can close panels you don't need by using the cross symbol on the upper right corner and make them reappear again through the View-menu. To actually use the remote debugger's functionality see section Tutorial. Most actions described here require use of the left mouse button, for the remainder of the text clicking a button means using the left mouse button. In the last section the available keyboard short-cuts are listed. User InterfaceMenu and ToolbarsThe file menu lets you open and save files, create and switch between projects and exit the application. The view menu lets you show hidden parts of the user interface. There is also the option to reset the complete window layout. With the debug menu you can control your debugging sessions (see section Debugging for details). The help menu finally directs you to further information on our website.The most common operations are directly accessible in the toolbars.
Main text editor panelThe text editor panel shows you all currently opened source code files. You can toggle between different source files by clicking on the tabs at the top of the panel. To close a specific source file press the cross in this row on the right edge of the panel.If you have opened many files you can use the arrows on the left and right side to move the currently shown tabs or use the small down arrow to directly jump to a specific file. The editor behaves like a regular text editor that in addition automatically highlights script commands. You can use it to directly write your source code. The most important part in conjunction with debugging is the setup of breakpoints. To set a break point press the left mouse button on the grey vertical bar to the right of the line numbers. A red dot will appear and signal the presence of the break point. Click on it again to remove it. Please be aware that you can only set breakpoints in source code lines that represent a script statement.
File browser panel
Variable overview panelThis panel shows you all variables and its assigned values in the current state.There are two tabs with global and local variables. Global variables are accessible from any code part. Whenever you create a new variable that is not directly stored inside a table or specified as local, a new global variable is generated. Local variables are either parameters passed to a function or newly created variables with the local keyword. Both tabs show a list with the variable name, its assigned value and its type. The contents of tables can be opened by using the + symbol in the variable list. For these contents a string representation of each key is used as name. If the key is a table its content is not visible.
Additional information panelCallstack tab
Breakpoint tab
Output tab
TutorialSetupTo create a new remote debugger project use the file menu with File / New Project.... In the window that appears you have to specify the project settings.
To be able to debug your program the debugger has to connect to the running application. The easiest way to manage this is by specifying the -autoConnectDebugger command line option in the XML-file for your application. The XML-entry should look similar to this line: <cmdline>game.exe -script scripts/main.lua -name test -autoConnectDebugger</cmdline>The mentioned command line option is added by default if you start the application within the debugger. You can still use the debugger without the autoConnectDebugger command line option by pressing F10 in the engine application. The status line at the bottom of the debugger will indicate the status of the connection to the game application. DebuggingAn important part of debugging are breakpoints. Whenever the script code execution reaches a code line with a breakpoint the execution paused. You can set breakpoints inside the text editor panel by clicking next to the code line number. A red dot will appear to show the position of the breakpoint. The code will be stopped before execution of the script statement in the current line. Please note that only lines with script statements can be used for breakpoints. To remove a breakpoint you can click on the red dot again.
Once a breakpoint is reached during execution of the script code the engine application pauses. Now you can inspect the current engine state with the help of the variable, the callstack and the output panel. You can also pause the engine application at any point in time without a breakpoint with the Break all-command. This command is useful when you need to know what the engine application currently does. To let the program continue use the Continue-command. SteppingTo further analyze the control flow of the script code and the change of variables you can also step the application on a line by line basis with the help of the Step into, Step over, and Step out commands.The functionality provided is, in short words:
The following screenshots show an example situation.
If we want to continue debugging we could use the Step into command which would lead us to line 27, the first line with a statement of the called function third(). The Step over command would result the engine application to pause at line 21. And the Step out command would finally run the same code but stop at line 11. Please note that line number 20 and 26 are no script statements and therefore you cannot set breakpoints on such lines. Keyboard short-cuts
ExporterAutodesk Maya1 i3d exporterTo generate i3d files of your 3d-models you can use the exporter plugin for Autodesk Maya. The GIANTS Editor and the GIANTS Engine can only load i3d files. This section of the documentation will show you, how to export i3d files with the I3D exporter plugins in Autodesk Maya. The first thing you probably want to do is to install the exporter plugins in Autodesk Maya. Installing I3D exporter pluginStep 1Place the files I3DExportUI.mel, I3DExportValidate.mel and I3DExporter2008.mll into the folder "C:/Documents and Settings/<USERNAME>/My Documents/maya/scripts". Step 2 Start Maya and open the Script Editor window.
Step 3 Select custom shelf tab Step 4 Type the following commands in the lower portion of the Script Editor:
Highlight the commands, then use the middle mouse button, to drag the highlighted MEL commands to the shelf. Note:
Step 5 Copy the I3D_icon.bmp into the folder "C:/Documents and Settings/<USERNAME>/My Documents/maya/2008/prefs/icons". Edit shelf to replace the default icon with the one enclosed. Preparing your 3d-model for exportBefore you can actually use the exporter, it’s wise to check certain things with your 3d-model in Maya which can cause issues later in the editor or the engine.In the Channel-Box you see the transformations of your selected object. ![]() The ScaleX, ScaleY and ScaleZ of your object should be 1 1 1. If you just plan to use this object as a static mesh or with no physics at all you could export it with any scale you want, but if you want to simulate your object in the engine (as a dynamic or kinematic rigid body object) the scale must be 1 1 1 otherwise the physics simulation will produce incorrect results. ![]() If you have an object with scale, you can easily get rid of the scale. Go to the Modify-Panel, and select the option box right of the Freeze Transformations. The Freeze Transformations dialog window opens. You can select the checkbox scale and hit apply. Note: Please refer to the artwork guide for further information about asset conditioning for the engine. I3D exporter usageStart the exporter dialog with a click on the I3D exporter icon you have created on your custom shelf (see Installing I3D exporter plugins)![]() Export Panel The export panel is quite self-explanatory. In the export options part you can include and exclude parts from exporting (IK, Animation, Shapes, Nurbs Curves, Lights, Cameras, Particle Systems and/or Default Cameras). The Shape Export Subparts section allows you to control which subshape attributes are exported (Normals, vertex Colors, Texture Coordinates and/or Skin Weights). The miscellaneous section has this options:
Buttons
Attributes Panel In the attributes panel you can load and save attributes of your objects those attributes will be saved into the Maya file and are translated into the correct i3d attributes when you export to a i3d file. ![]() The first thing you have to do here is, that you must press the "Load Current" button at the bottom in order to load the attibutes of your object. Otherwise everything is unchecked and is not showing the attributes that are currently active on you object. So be sure, to hit this button first. Current Node Here you can see the name of your current working object. Rigid Body This section handles all the attributes regarding to physics rigid bodies. Joint Here you can define your joint-attributes in detail. One thing you might miss here are the joint limits, they must be defined within Maya, since your object can have many joints with different limits. You can define the limit of a joint angle by the limit informations of your transform-object. Rendering
Validate Panel With this panel you can validate if one of your objects have an incorrect pivot. In Maya your pivot can have a local and a world space attribute which you can find in the attribute editor on the right side. The x y and z values of both, local and world-space have to be 0 0 0 otherwise you will get a warning. You can fix incorrect pivots with the FreeezeToPivot option in the tools panel. Tools If you have validated your objects and a local pivot was not set to 0 0 0, you can quickly fix affected objects with the FreeezeToPivot button. Known issues
Material export optionsMapping between Maya and i3d material attributes
Material Attributes
Autodesk 3ds MAX2 i3d exporterInstalling I3D exporter pluginCopy the plugin file I3DExporter2008.dle or I3DExporter2009.dle into this directory:%3DSMAX installation path%/plugins/ On a Windows XP (english version) this would be this path: C:\Program Files\Autodesk\3ds Max 2009\plugins for example. Blender i3d exporterInstalling I3D exporter plugin (Windows)
Installing I3D exporter plugin (Linux)You'll find a hidden directory called ".blender" in your home directory. Inside there's a sub-directory called "scripts", place the file blenderI3DExport.py there. Restart Blender.1,2 Autodesk 3ds MAX and Autodesk Maya are registered trademarks of the Autodesk Corp. Content Creation - Artwork GuideAutodesk MayaSet correct normalsAdjust normals to match topology. Use hard edges for cubic and soft edges for curved surfaces.
Disable double sided option
Remove zero area polygons
Eliminate T-Injunction
Autodesk 3DS MAXRemove useless polygons
Generate normalmaps for detailsGenerate Normalmaps for appropriate details in the geometry.
Flip edgesFlip/turn edges to match topology of the polygon mesh. Retriangulation of the polygon mesh is a good starting point. This works only with Editable Polys
Convert to a Editable Mesh
Flip/Turn individual edges manually
Disable two sided material optionTwo sided materials are not supported in the engine and have to be replaced by an inverted copy of the affected polygons.
Used operations
Set correct normalsAdjust normals to match topology. Use hard edges for cubic and soft edges for curved surfaces.
Used operations
Merge to single polygon meshMerge groups of objects to a single mesh for optimal in-game performance.
Used operations
TexturingJPEG compression artifactsNever use the JPG format to store textures. Each time a jpg file is stored the quality of the image decreases. Even if the compression quality is set to 100%.
Non-Power-of-Two texturesUse power-of-two textures but you can use non-squared textures. As a general
rule you should make your textures as big as they are in pixels when beeing
projected onto the screen in the game. Texture sizeTexture size must be 2048x2048 pixels or smaller. Bigger textures are not supported on older graphics cards (eg. GeforceFX, Radeon9xxx, Radeon8xx and Intel onboard graphic chips). Generate maps for parallaxmappingRequirements
I3D FormatIntroductionI3D is an open eXtensible Markup Language (XML) file format.The purpose of i3D is to interchange 3D assets between applications and platforms without loss of information. ![]() A vaild I3D file can have up to seven parts: Textures, Materials, Shapes, Dynamics, Scene graph, Animation and Userdata. Dependent on application each part can be omitted. The XML Schema language is used to describe the I3D feature set. Download: I3D 1.6 Schema Features
OverviewSpecificationGeneral Layout
Coordinate SystemsI3D uses a right-handed coordinate system.FilesAll used file references are defined here. File handles are mapped to the corresponding filenames.
MaterialsMaterials used in the materials attribute of Shape nodes within the scenegraph section are defined in this section.
ShapesShapes are defined here and referenced from the Scene graph section. This mechanism allows multiple instancing of shapes.
Shape node typesIndexedTriangleSet
Vertices
v
Triangles
t
Subsets
Subset
Example
NurbsCurve
cv
Example
DynamicsDynamic objects are defined in this part and referenced from the Scene graph section.
ScenegraphThe Scene graph hierarchy (transformations, bones, joints, shapes, lights, cameras and particle systems) are stored in this section. Shapes, materials and particle systems are stored as references.
Scene graph node typesTransformGroup
Shape
Camera
Light
5 Dynamic
Example
AnimationMotions are defined in this part. Clips are the basic building block and allow Non-Linear Animation by composing multiple clips.
I3D Example: Quad
Test ScenesNote: Test scenes are bundled with the editor.
|