Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CSG Animation Tool.
- * Combine CSG with skeletal animation.
- * The top level will exist as a list of objects.
- * References from one object to another will be based on name.
- CSG Solids
- * CSG Solids will exist within Models.
- * CSG Solids will be applied in-order.
- * Solids may be either positive or negative.
- ** A negative solid will "cut a hole" in any preceding solids.
- * Rounded solids will be approximated via polyhedra.
- ** The tessellation of the surface will be implicit.
- * Solids with a transparent textures may only clip objects with the same texture.
- ** Likewise, they may only be clipped by the same texture.
- Bones
- * A given Model may contain Bones.
- * CSG solids may be attached to bones.
- ** CSG solids assigned to different bones will not normally clip.
- Model notation will be based on objects and lists.
- Object:
- ObjType {
- ...
- }
- ObjType objName {
- ...
- }
- Objects will contain key-value pairs:
- * key: value
- ** Comma separators will be optional.
- * Objects may contain other objects.
- * Keys will be identifiers.
- Identifier:
- * Consists of 'A'..'Z', 'a'..'z', '0'..'9', '_', and '$'.
- * Must start with a letter or underscore.
- Value types will be one of several types:
- * Integer literal
- ** 1234567
- ** 0x1234ABCD
- ** ...
- * Floating point literal
- ** 3.14159
- * String Literal
- ** "Foo"
- ** Adjacent string literals may merge without a separator.
- ** Escape sequences will be similar to those in C.
- * Symbol
- ** #name
- ** May be used as an identifier for another object.
- ** Functionally similar to a string in most other regards.
- * List / Array
- ** [ 1 2 3 ]
- ** Comma separators will be optional.
- ** Lists may contain arbitrary value types.
- * Vector
- ** #[ x y ]
- ** #[ x y z ]
- ** #[ x y z w ]
- ** Consists of 2-4 floating point numbers.
- * ...
- Origins will be given with in a local or global XYZ space.
- Rotations will be given as axis/angle, with the angle given in degrees.
- The coordinate space will not be formally specified here, but for now will assume a unit size roughly comparable to an inch.
- Objects:
- * Model
- ** Top-level model object, contains Bones and solids
- ** Models may be instanced.
- * Bone
- ** Defines part of a skeleton.
- ** Contains an origin and parent.
- ** Bones without a parent are relative to the model.
- * Solids
- ** Will come in various forms.
- ** Box: Box, given as min/max or origin/size
- *** May be given a rotation.
- ** Sphere: Spheroid, given as origin/radius.
- *** Radius may be either a floating point number or a vector.
- ** Cylinder: Cylinder, Flat Ends, given as start/end and radius.
- ** CappedCylinder: Cylinder, Round Ends, given as start/end and radius.
- ** ...
- Model model1 {
- Bone base { origin: #[ 0 0 0] }
- Bone leftArm { origin: #[-10 0 10] parent: #base }
- Bone rightArm { origin: #[ 10 0 10] parent: #base }
- Bone leftHand { origin: #[-40 0 15] parent: #leftArm }
- Bone rightHand { origin: #[ 40 0 15] parent: #rightArm }
- Bone head { origin: #[ 0 0 20] parent: #base }
- Sphere torsoSphere { origin: #[ 0 0 0] radius: 20 bone: #base }
- Sphere headSphere { origin: #[ 0 0 25] radius: 10 bone: #head }
- Sphere lfHandSp { origin: #[-40 0 15] radius: 20 bone: #leftHand }
- Sphere rtHandSp { origin: #[ 40 0 15] radius: 20 bone: #rightHand }
- }
- If a Solid is not given a bone, it will exist at a fixed location within the model.
- Textures will be applied to solids rather than to individual faces.
- * Textures will contain of references to external texture images.
- ** One of several possible search paths may be used.
- ** File extension may be added implicitly.
- * A texture object will define the projection strategy.
- ** Sphere: Spherical coordinates relative to a local space.
- ** Box: Nearest face on a 6-sided box within local space.
- ** Plane:
- Texture tex1 {
- image: "textures/foo/bar"
- proj_type: #Sphere
- proj_x: #[1 0 0]
- proj_y: #[0 1 0]
- proj_z: #[0 0 1]
- proj_origin: #[0 0 0]
- transparent: 1
- }
- Polyhedra / Brush
- * Will define an arbitrary solid in terms of planes.
- * Each plane will contain a normal.
- ** The first three numbers will give the plane direction.
- ** The fourth number will give the distance.
- Brush br1 {
- texture: tex1
- Plane { normal: #[-1 0 0 10] }
- Plane { normal: #[ 1 0 0 10] }
- Plane { normal: #[ 0 -1 0 10] }
- Plane { normal: #[ 0 1 0 10] }
- Plane { normal: #[ 0 0 -1 10] }
- Plane { normal: #[ 0 0 1 10] }
- }
- Animations:
- * Animations exist within a model.
- ** Each animation will consist of frames.
- ** The frames will define the bone positions at that time.
- *** These will either displace the origin or apply a rotation.
- *** Translations will be relative to the base origin.
- *** Rotations will be given in axis/angle.
- ** Each child bone will be relative to the position of the parent bone.
- *** In effect, the transforms will be combined.
- ** If a bone position is absent in a given frame, it will be interpolated.
- Anim jump1 {
- frametime: 0.1 //10 frames per second
- Frame {
- BonePos base { org: #[0 0 0] }
- BonePos leftArm { rot: #[0 1 0 0] }
- BonePos rightArm { rot: #[0 1 0 0] }
- }
- Frame { }
- Frame { }
- Frame { }
- Frame { }
- Frame {
- BonePos base { org: #[0 0 15] }
- BonePos leftArm { rot: #[0 1 0 30] }
- BonePos rightArm { rot: #[0 1 0 -30] }
- }
- Frame { }
- Frame { }
- Frame { }
- Frame { }
- }
- === Scenes ===
- Scene (If Relevant):
- * A Scene will be composed of Entities.
- ** Each Entity will be an instance of a Model.
- ** Entities may be given an origin and rotation, and given an animation.
- * Events will happen at time-codes.
- Import { path: "models/model1" }
- Entity ent1 {
- model: #model1
- origin: #[320 400 16]
- rotation: #[0 0 0]
- }
- Event ev0 {
- time: 0.0
- entity: ent1
- anim: idle1
- }
- Event ev1 {
- time: 16.0
- entity: ent1
- anim: jump1
- }
- If no events exist for an entity, it will exist as a static object.
- Entities could also be assigned to scripts, in which case the script will manage any behaviors.
Advertisement
Add Comment
Please, Sign In to add comment