User Tools

Site Tools


ofp:modeling:animations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ofp:modeling:animations [2007-07-04 19:25]
snakeman created animations initial page
ofp:modeling:animations [2017-10-06 21:51] (current)
snakeman http to https switch.
Line 1: Line 1:
 ====== Animations ====== ====== Animations ======
  
-{{ http://tactical.nekromantix.com/images/wiki/​AnimatedDoors.jpg}}+{{ https://pmc.editing.wiki/​images/​AnimatedDoors.jpg}}
  
-This articles talks about simple, single-p3d animations, where parts of a model rotate around an axis (like a car door, or a tank turret). ​+This articles talks about simple, single-p3d animations, where parts of a model rotate around an axis (like a car door, or a tank turret).
  
-Complex animations for soldier'​s movements for example are a different issue altogether... ​+Complex animations for soldier'​s movements for example are a different issue altogether...
  
-To create a model animations, these are the requirements: ​+To create a model animations, these are the requirements:​
  
 Create the movable object in the ResolutionLOD and give it a name. Create the movable object in the ResolutionLOD and give it a name.
 If the animation would affect the ( Fire) GeometryLOD,​ copy the selection into those LODs as well. If the animation would affect the ( Fire) GeometryLOD,​ copy the selection into those LODs as well.
 In the MemoryLOD define the rotational axis via two vertexes. Select both of those points and give them a name. In the MemoryLOD define the rotational axis via two vertexes. Select both of those points and give them a name.
-Still in the MemoryLOD create a single vertex (this will be the '​action point'​) and give it a name. +Still in the MemoryLOD create a single vertex (this will be the '​action point'​) and give it a name.
  
 In the Config.cpp for your model you need to define two classes: Animations & UserActions. In the Config.cpp for your model you need to define two classes: Animations & UserActions.
-The Animations class defines how the object moves, and the UserActions class defines when it moves. ​+The Animations class defines how the object moves, and the UserActions class defines when it moves.
  
 The following example is for an object that has been named '​door',​ which turns around an axis named 'door axis'. The '​action point' (the position the player has to be close to, in order to be able to activate this animation) is called '​doorbell'​. The following example is for an object that has been named '​door',​ which turns around an axis named 'door axis'. The '​action point' (the position the player has to be close to, in order to be able to activate this animation) is called '​doorbell'​.
  
-<​code>​+<​code ​cpp>
 class Animations class Animations
 { {
-  ​class MoveDoor + class MoveDoor 
-  +
-    type="​rotation";​ // always "​rotation"​ + type="​rotation";​ // always "​rotation"​ 
-    animPeriod=1;​ // how long it takes for the movevement to finish + animPeriod = 1; // how long it takes for the movevement to finish 
-    selection="​door";​ // the name of the moving object + selection = "​door";​ // the name of the moving object 
-    axis="​door axis"; // the name of the axis + axis = "door axis"; // the name of the axis 
-    angle0=0 // the start angle + angle0 = 0// the start angle 
-    angle1=-2.0; // the end angle, in radians (= degrees/​57.3 = degrees * 180/π+ angle1 = -2; // the end angle, in radians (= degrees/​57.3 = degrees * 180/?
-  };+ };
 }; };
 </​code>​ </​code>​
  
-<​code>​+<​code ​cpp>
 class UserActions class UserActions
 { {
-  ​class OpenDoor // action to open the door + class OpenDoor // action to open the door 
-  +
-    displayName="​Open Door";​ //​ string that's displayed in the action menu + displayName = "Open Door";​ //​ string that's displayed in the action menu 
-    position="​doorbell";​ // name of the '​action point'​ + position = "​doorbell";​ // name of the '​action point'​ 
-    radius=1.5; // how close the player has to be see this action + radius = 1.5; // how close the player has to be see this action 
-    condition="​this animationPhase ""​MoveDoor""​ < 0.5";​ //​ check whether the door has moved already + condition = "this animationPhase ""​MoveDoor""​ < 0.5";​ //​ check whether the door has moved already 
-    statement="​this animate[""​MoveDoor"",​1]";​ // and if not, then start the animation + statement = "this animate[""​MoveDoor"",​1]";​ // and if not, then start the animation 
-    onlyforplayer = true; // requirement by ArmA - presumably defines if AI can/cannot open doors etc + onlyforplayer = true; // requirement by ArmA - presumably defines if AI can/cannot open doors etc 
-  }; + }; 
-  class CloseDoor // action to close the door + class CloseDoor // action to close the door 
-  +
-   ​displayName="​Close Door";​ + displayName = "Close Door";​ 
-   ​position="​doorbell";​ + position = "​doorbell";​ 
-   ​radius=1.5;​ + radius = 1.5; 
-   ​condition="​this animationPhase ""​MoveDoor""​ < 0.5";​ + condition = "this animationPhase ""​MoveDoor""​ < 0.5";​ 
-   ​statement="​this animate[""​MoveDoor"",​0]";​ + statement = "this animate[""​MoveDoor"",​0]";​ 
-   ​onlyforplayer = true;  + onlyforplayer = true; 
-  };+ };
 }; };
 </​code>​ </​code>​
Line 60: Line 60:
 ====== Tutorials ====== ====== Tutorials ======
  
-A tutorial model (a two-winged door with moving geometry) can be downloaded from [[http://​vbs.no-ip.com/​tuts/​TUT_animated_door.zip|here]].+A tutorial model (a two-winged door with moving geometry) can be downloaded from [[http://​vbs.no-ip.com/​tuts/​TUT_animated_door.zip|here]]. <- link dead, obviously.
ofp/modeling/animations.1183577102.txt.gz · Last modified: 2007-07-10 09:52 (external edit)