toly1917

Members
  • Content Count

    12
  • Joined

  • Last visited

About toly1917

  • Rank
    Member

Recent Profile Visitors

495 profile views
  1. Hi, everybody. There are difficulties with realization of skeletal animation.There is json the file with all mesh, materials and skeletons. Each animated mesh has properties:"boneIndex" (array of bones which are tied with tops)"boneWeight" (weight of all tops)All bones have such parameters, as:"id","parentId" (the identifier of a parental bone (if that isn't present, =-1)),"matrix" (I am so understood, it is a matrix on the basis of which there are transformations (as if the center of transformations though I can be mistaken)),"frames" (array of all frames of animation)Question: How to realize skeletal animation in a shader and how to realize system "the parent - the child"?animation example from file json:"skeletons": [{ "name": "skelet", "bones": [{ "name": "Bone", "index": 0, "matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, -0.6955, -0.647, -2.3721, 1], "parentBoneIndex": -1, "animation": { "dataType": 3, "framePerSecond": 24, "keys": [{ "frame": 1, "values": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, -0.6955, -0.647, -2.3721, 1] }, { "frame": 2, "values": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, -0.6955, -0.647, -2.3721, 1] }... { "frame": 30, "values": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, -0.6955, -0.647, -2.3721, 1] }], "loopBehavior": 1, "name": "anim", "property": "_matrix" } }, { "name": "Bone.001", "index": 1, "matrix": [0.7021, 0, -0.712, 0, -0.3347, 0.8826, -0.3301, 0, 0.6285, 0.4701, 0.6197, 0, 0, 1, 0, 1], "parentBoneIndex": 0, "animation": { "dataType": 3, "framePerSecond": 24, "keys": [{ "frame": 1, "values": [0.7021, 0, -0.712, 0, -0.3347, 0.8826, -0.3301, 0, 0.6285, 0.4701, 0.6197, 0, 0, 1, 0, 1] }, { "frame": 2, "values": [0.7021, 0.0029, -0.712, 0, -0.3347, 0.8839, -0.3265, 0, 0.6285, 0.4676, 0.6216, 0, 0, 1, 0, 1] }, { "frame": 3, "values": [0.7021, 0.0115, -0.7119, 0, -0.3347, 0.8878, -0.3158, 0, 0.6285, 0.46, 0.6272, 0, 0, 1, 0, 1] }... { "frame": 30, "values": [0.7021, 0.7012, 0.1236, 0, -0.3347, 0.1719, 0.9265, 0, 0.6285, -0.6919, 0.3554, 0, 0, 1, 0, 1] }], "loopBehavior": 1, "name": "anim", "property": "_matrix" } }]}]If the application code is necessary, I will kindly provide it
  2. Hi, everybody. The algorithm of creation of an array of bones of "mBone" is necessary.
  3. Dear Deltakosh, I do this scene without use of babylon.js Simply it isn't clear to me why this animation is wrong? All code which is connected to animation I gave above. I want to learn, whether the shader code is correctly written, and also, whether correctly I process "matriceIndices" and "matriceWeight"?
  4. Example (do not laugh). after loading press any button on the keypad
  5. Here that at me it turned out: vs: attribute vec4 boneWeight;attribute vec4 boneIndex;...void main(){ mat4 m0 = mBone[int(boneIndex.x)] * boneWeight.x;mat4 m1 = mBone[int(boneIndex.y)] * boneWeight.y;mat4 m2 = mBone[int(boneIndex.z)] * boneWeight.z;mat4 m3 = mBone[int(boneIndex.w)] * boneWeight.w;vec4 pos=MoveMat*((m0 + m1 + m2 + m3)*vec4(position,1.0));} boneIndex: var floatIndices = [];for (var i = 0; i < boneIndex.length; i++){var matricesIndex = boneIndex;floatIndices.push(matricesIndex & 0x000000FF);floatIndices.push((matricesIndex & 0x0000FF00) >> 8);floatIndices.push((matricesIndex & 0x00FF0000) >> 16);floatIndices.push(matricesIndex >> 24);} it is taken from babylon.js . I send "floatIndices" mBone: var _mBone=[],mBone=[]; for(var i=0;i<bonesOnSkeleton.length;i++){ _mBone.push(self.gl.getUniformLocation(self._Program,"mBone["+i+"]"));mBone.push(bonesOnSkeleton.matrix);//bonesOnSkeleton==(in babylon.js file: skeletons[0].bones)}The program all the same works not correctly P.S. Syntax errors aren't present
  6. { "name": "test","index": 0,"matrix": [0.0095, -0.0017, -0.0026, 0, 0.0006, 0.0093, -0.0037, 0, -0.0031, -0.0034, -0.0089, 0, 0.0029, 0.8437, -0.0106, 1],"parentBoneIndex": -1,"animation": { "dataType": 3, "framePerSecond": 30, "keys": [{ "frame": 1, "values": [0.0095, -0.0017, -0.0026, 0, 0.0006, 0.0093, -0.0037, 0, -0.0031, -0.0034, -0.0089, 0, 0.0029, 0.8437, -0.0106, 1] }, { "frame": 2, "values": [0.0097, -0.0008, -0.0024, 0, -0.0001, 0.0093, -0.0036, 0, -0.0025, -0.0035, -0.009, 0, 0.0056, 0.8546, -0.0065, 1] }, { "frame": 3, "values": [0.0099, 0.0003, -0.0017, 0, -0.0009, 0.0092, -0.0038, 0, -0.0015, -0.0039, -0.0091, 0, 0.0059, 0.8707, -0.0067, 1] }, { "frame": 4, "values": [0.0099, 0.0008, -0.0008, 0, -0.0011, 0.0091, -0.004, 0, -0.0004, -0.0041, -0.0091, 0, 0.0053, 0.8852, -0.0073, 1] }, { "frame": 5, "values": [0.01, 0.0007, 0.0001, 0, -0.0006, 0.0091, -0.0042, 0, 0.0004, -0.0041, -0.0091, 0, 0.0079, 0.8951, -0.0067, 1] }, { "frame": 6, "values": [0.01, 0.0006, 0.0006, 0, -0.0003, 0.0092, -0.0039, 0, 0.0008, -0.0039, -0.0092, 0, 0.0115, 0.894, -0.0006, 1] }, { "frame": 7, "values": [0.0099, 0.0006, 0.0008, 0, -0.0003, 0.0094, -0.0035, 0, 0.001, -0.0035, -0.0093, 0, 0.0141, 0.8858, 0.0059, 1] }, { "frame": 8, "values": [0.0099, 0.0008, 0.0008, 0, -0.0005, 0.0094, -0.0033, 0, 0.001, -0.0032, -0.0094, 0, 0.016, 0.874, 0.0157, 1] }, { "frame": 9, "values": [0.0099, 0.001, 0.0009, 0, -0.0007, 0.0095, -0.0032, 0, 0.0012, -0.0031, -0.0094, 0, 0.0188, 0.8543, 0.0353, 1] }, { "frame": 10, "values": [0.0098, 0.0013, 0.0013, 0, -0.0008, 0.0094, -0.0033, 0, 0.0017, -0.0031, -0.0093, 0, 0.0195, 0.8379, 0.0618, 1] }, { "frame": 11, "values": [0.0097, 0.001, 0.0021, 0, -0.0003, 0.0094, -0.0034, 0, 0.0023, -0.0032, -0.0092, 0, 0.0163, 0.8276, 0.0755, 1] }, { "frame": 12, "values": [0.0096, 0.0005, 0.0026, 0, 0.0004, 0.0094, -0.0033, 0, 0.0026, -0.0033, -0.0091, 0, 0.0143, 0.8315, 0.0731, 1] }, { "frame": 13, "values": [0.0097, -0.0001, 0.0024, 0, 0.0009, 0.0094, -0.0033, 0, 0.0023, -0.0034, -0.0091, 0, 0.0149, 0.849, 0.0616, 1] }, { "frame": 14, "values": [0.0098, -0.0009, 0.0016, 0, 0.0014, 0.0093, -0.0034, 0, 0.0011, -0.0036, -0.0093, 0, 0.0161, 0.8666, 0.048, 1] }, { "frame": 15, "values": [0.0099, -0.0015, 0.0005, 0, 0.0016, 0.0092, -0.0037, 0, -0.0001, -0.0037, -0.0093, 0, 0.0164, 0.8816, 0.037, 1] }, { "frame": 16, "values": [0.0099, -0.0015, -0.0003, 0, 0.0013, 0.0091, -0.0039, 0, -0.0009, -0.0038, -0.0092, 0, 0.0137, 0.8971, 0.0264, 1] }, { "frame": 17, "values": [0.0099, -0.0013, -0.0005, 0, 0.001, 0.0092, -0.0038, 0, -0.001, -0.0037, -0.0092, 0, 0.0114, 0.8999, 0.0234, 1] }, { "frame": 18, "values": [0.0099, -0.0011, -0.0006, 0, 0.0008, 0.0093, -0.0036, 0, -0.001, -0.0035, -0.0093, 0, 0.0105, 0.896, 0.0175, 1] }, { "frame": 19, "values": [0.0099, -0.0011, -0.0008, 0, 0.0008, 0.0093, -0.0035, 0, -0.0012, -0.0034, -0.0093, 0, 0.0089, 0.8832, 0.0066, 1] }, { "frame": 20, "values": [0.0098, -0.0015, -0.0012, 0, 0.001, 0.0093, -0.0035, 0, -0.0016, -0.0033, -0.0093, 0, 0.005, 0.8624, 0.0008, 1] }, { "frame": 21, "values": [0.0096, -0.0022, -0.0017, 0, 0.0014, 0.0091, -0.0038, 0, -0.0024, -0.0035, -0.0091, 0, 0.0026, 0.8442, 0.0096, 1] }, { "frame": 22, "values": [0.0095, -0.0022, -0.0023, 0, 0.0012, 0.0091, -0.004, 0, -0.0029, -0.0036, -0.0089, 0, 0.0022, 0.8353, 0.0092, 1] }, { "frame": 23, "values": [0.0095, -0.0017, -0.0026, 0, 0.0006, 0.0093, -0.0037, 0, -0.0031, -0.0034, -0.0089, 0, 0.0029, 0.8437, -0.0106, 1] }, { "frame": 250, "values": [0.0095, -0.0017, -0.0026, 0, 0.0006, 0.0093, -0.0037, 0, -0.0031, -0.0034, -0.0089, 0, 0.0029, 0.8437, -0.0106, 1] }], "loopBehavior": 1, "name": "anim", "property": "_matrix"}} where here m0, m1, m2 and m3?
  7. what is m0, m1, m2, m3 and how to calculate them?
  8. Why matricesWeights property comprises information on 4 values. Why they are necessary? For example: "matricesWeights": [0, 1, 0, 0, 0, 1, 0, 0,...] Why each of values is necessary?
  9. for what the array of "matricesIndices" and why it has very great values is necessary? "matricesIndices": [33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760, 33685760]
  10. in case of export to babylon.js the file appears an error. LOG: Babylon.js Exporter version: 1.8.0, Blender version: 2.74 (sub 0)========= Conversion from Blender to Babylon.js =========Python World class constructor completedprocessing begun of material: untitled.Material__40Ambient texture foundDiffuse texture foundprocessing begun of skeleton: Armature, id: 0processing begun of bone: mixamorig:Hips, index: 0animation begun of bone: mixamorig:Hipsprocessing begun of bone: mixamorig:Spine, index: 1animation begun of bone: mixamorig:Spineprocessing begun of bone: mixamorig:Spine1, index: 2animation begun of bone: mixamorig:Spine1processing begun of bone: mixamorig:Spine2, index: 3animation begun of bone: mixamorig:Spine2processing begun of bone: mixamorig:Neck, index: 4animation begun of bone: mixamorig:Neckprocessing begun of bone: mixamorig:Head, index: 5animation begun of bone: mixamorig:Headprocessing begun of bone: mixamorig:HeadTop_End, index: 6animation begun of bone: mixamorig:HeadTop_Endprocessing begun of bone: mixamorig:LeftShoulder, index: 7animation begun of bone: mixamorig:LeftShoulderprocessing begun of bone: mixamorig:LeftArm, index: 8animation begun of bone: mixamorig:LeftArmprocessing begun of bone: mixamorig:LeftForeArm, index: 9animation begun of bone: mixamorig:LeftForeArmprocessing begun of bone: mixamorig:LeftHand, index: 10animation begun of bone: mixamorig:LeftHandprocessing begun of bone: mixamorig:LeftHandIndex1, index: 11animation begun of bone: mixamorig:LeftHandIndex1processing begun of bone: mixamorig:LeftHandIndex2, index: 12animation begun of bone: mixamorig:LeftHandIndex2processing begun of bone: mixamorig:LeftHandIndex3, index: 13animation begun of bone: mixamorig:LeftHandIndex3processing begun of bone: mixamorig:LeftHandIndex4, index: 14animation begun of bone: mixamorig:LeftHandIndex4processing begun of bone: mixamorig:RightShoulder, index: 15animation begun of bone: mixamorig:RightShoulderprocessing begun of bone: mixamorig:RightArm, index: 16animation begun of bone: mixamorig:RightArmprocessing begun of bone: mixamorig:RightForeArm, index: 17animation begun of bone: mixamorig:RightForeArmprocessing begun of bone: mixamorig:RightHand, index: 18animation begun of bone: mixamorig:RightHandprocessing begun of bone: mixamorig:RightHandIndex1, index: 19animation begun of bone: mixamorig:RightHandIndex1processing begun of bone: mixamorig:RightHandIndex2, index: 20animation begun of bone: mixamorig:RightHandIndex2processing begun of bone: mixamorig:RightHandIndex3, index: 21animation begun of bone: mixamorig:RightHandIndex3processing begun of bone: mixamorig:RightHandIndex4, index: 22animation begun of bone: mixamorig:RightHandIndex4processing begun of bone: mixamorig:LeftUpLeg, index: 23animation begun of bone: mixamorig:LeftUpLegprocessing begun of bone: mixamorig:LeftLeg, index: 24animation begun of bone: mixamorig:LeftLegprocessing begun of bone: mixamorig:LeftFoot, index: 25animation begun of bone: mixamorig:LeftFootprocessing begun of bone: mixamorig:LeftToeBase, index: 26animation begun of bone: mixamorig:LeftToeBaseprocessing begun of bone: mixamorig:LeftToe_End, index: 27animation begun of bone: mixamorig:LeftToe_Endprocessing begun of bone: mixamorig:RightUpLeg, index: 28animation begun of bone: mixamorig:RightUpLegprocessing begun of bone: mixamorig:RightLeg, index: 29animation begun of bone: mixamorig:RightLegprocessing begun of bone: mixamorig:RightFoot, index: 30animation begun of bone: mixamorig:RightFootprocessing begun of bone: mixamorig:RightToeBase, index: 31animation begun of bone: mixamorig:RightToeBaseprocessing begun of bone: mixamorig:RightToe_End, index: 32animation begun of bone: mixamorig:RightToe_Endprocessing complete of skeleton: Armatureprocessing begun of mesh: Mesh_0326WARNING: No materials have been assigned: num positions : 186num normals : 186num uvs : 372num uvs2 : 0num colors : 0num indices : 186num skeletonWeights: 744num skeletonIndices: 744processing begun of mesh: Mesh_0248WARNING: No materials have been assigned: num positions : 2592num normals : 2592num uvs : 5184num uvs2 : 0num colors : 0num indices : 2592num skeletonWeights: 10368num skeletonIndices: 10368processing begun of mesh: Mesh_0260WARNING: No materials have been assigned: num positions : 7212num normals : 7212num uvs : 14424num uvs2 : 0num colors : 0num indices : 7212num skeletonWeights: 28848num skeletonIndices: 28848processing begun of mesh: Mesh_0215WARNING: No materials have been assigned: num positions : 120num normals : 120num uvs : 240num uvs2 : 0num colors : 0num indices : 120num skeletonWeights: 480num skeletonIndices: 480processing begun of mesh: Mesh_0251WARNING: No materials have been assigned: num positions : 2034num normals : 2034num uvs : 4068num uvs2 : 0num colors : 0num indices : 2034num skeletonWeights: 8136num skeletonIndices: 8136processing begun of mesh: Mesh_0201WARNING: No materials have been assigned: num positions : 72num normals : 72num uvs : 144num uvs2 : 0num colors : 0num indices : 72num skeletonWeights: 288num skeletonIndices: 288processing begun of mesh: Mesh_0325WARNING: No materials have been assigned: num positions : 126num normals : 126num uvs : 252num uvs2 : 0num colors : 0num indices : 126num skeletonWeights: 504num skeletonIndices: 504processing begun of mesh: Mesh_0244========= An error was encountered ========= File "E:\Steam\steamapps\common\Blender\2.74\scripts\addons\io_export_babylon.py", line 280, in execute mesh = Mesh(object, scene, self.multiMaterials, nextStartFace, forcedParent, nameID, self.export_noVertexOpt) File "E:\Steam\steamapps\common\Blender\2.74\scripts\addons\io_export_babylon.py", line 615, in __init__ self.billboardMode = BILLBOARDMODE_ALL if object.material_slots[0].material.game_settings.face_orientation == 'BILLBOARD' else BILLBOARDMODE_NONE;ERROR: 'NoneType' object has no attribute 'game_settings'========= end of processing ========= Blender version 2.74
  11. There are certain difficulties in implementation of shadows on webgl. It is possible to look at an example here-> https://webgl-project-toly19.c9.io/index.html I did everything as on webglAcademy, but it turned out incorrectly. P.S. the model of the sphere weighs about 1 MB