• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Noxil

Members
  • Content count

    54
  • Joined

  • Last visited

Community Reputation

788 Good

About Noxil

  • Rank
    Member
  1. Oh my... I cant thank you enough! I finally found the problem! And you where so correct in your last statement, the SKIN! So the problem was a missunderstanding on my side on how to apply the skinning correctly in the shader. I have been fighting with this problem for so long now. There are so many places where things can go wrong, export, import, interpolations, rigs, heirarchies etc etc. What helped me the most was the fact that you posted images from your engine showing my mesh. Thank you so much!
  2. If that is your result then you get the same result as i do. My keyframe in maya it rotates to about 90 degree This is frame 30 for me. So im assuming i have done something really wrong in maya then! Edit: So hmm if it works for you, then yeah it must be the skin then i guess. Thank you for trying it out
  3. Thanks for pointing this out DonDickieD. These are my main matrix functions. Perhaps i have done something wrong here? void matrixCreateTransform( Matrix4v4 * p_Result, const Vec3f & p_Translation, const Vec3f & p_Scale, const Quaternion & p_Rotation ) { XMMATRIX translation = XMMatrixTranslation( p_Translation.x, p_Translation.y, p_Translation.z ); XMMATRIX scale = XMMatrixScaling( p_Scale.x, p_Scale.y, p_Scale.z ); XMMATRIX rotation = XMMatrixRotationQuaternion( makeVectorRegister(p_Rotation.axis.x, p_Rotation.axis.y, p_Rotation.axis.z, p_Rotation.amount) ); XMMATRIX m = XMMatrixMultiply( scale, rotation ); XMStoreFloat4x4A( (XMFLOAT4X4A *)p_Result, XMMatrixMultiply(m, translation) ); } void matrixMultiply( Matrix4v4 * p_Result, const Matrix4v4 * p_A, const Matrix4v4 * p_B ) { XMMATRIX a = XMLoadFloat4x4A( (const XMFLOAT4X4A *)p_A ); XMMATRIX b = XMLoadFloat4x4A( (const XMFLOAT4X4A *)p_B ); XMMATRIX r = XMMatrixMultiply( a, b ); XMStoreFloat4x4A( (XMFLOAT4X4A *)p_Result, r ); }
  4. So i have tried some euler to quaternion with no success. I get a another type of rotation, it dosnt rotate from the root bone any more but just slighly bends in the middle instead. It looks further away from the direction i should be heading if i compare to the quaternion rotation. But im not quite sure that i got it all right. I did the quaternion multiplications myself, aswell as to use the DX11 function "XMQuaternionRotationRollPitchYaw". They both gave the same result. It feels like the quaternion i get from "GetQ" using "boneNode->EvaluateLocalTransform(time)" is not the correct value or something. When i load the frames and extract the quaternion in my engine. If i multiply the w component with 2.0f the animation seems to rotate almost to the point where it should.
  5. Thank you both for your replies, i will make some tests regarding your posts. As per request from ongamex92 i have attached the maya file and fbx file. Edit: Reuploaded .mlt file, it hade unsaved changes (dont know what they where) anim_scene.fbx anim_test.mlt
  6. Okey so now im using the cluster in the same maner you are regarding the inverse bind pose. Also i now use the node from cluster->GetLink() to retreive the animation frame data. And the result is the same Rotation in frames is extracted like so: FbxAMatrix transform = boneNode->EvaluateLocalTransform( time ); frame->m_Rotation = transform.GetQ(); So i dont use GetR but instead GetQ. Is this a problem? It must be something super simple. Everything looks right but its just not rotating all the way so to say.. Edit: Also, i created a new mesh, new rig and new animation with less bones. Same problem. Are there some settings in Maya i need to be aware off maybe?
  7. Hey thanks for replying. Im assuming you get your cluster from the FbxMesh right? Do you know if there is a difference in going from the deformer instead of getting the node directly from the scene? What im wondering is if the deformer has other functions or properties that does something that the node does not. Also for the keyframes, do you use the child nodes from the deformer or how do you access them? In my exporter im looping through the scene nodes, find a skeleton type node then iterate over all its children. So what i can see right of the bat is that your are getting the bind pose from the deformer and im using the regular node. Might be something? I will have to do some tests when i get back home, thanks for sharing your example
  8. Hello, I have been fighting for sometime now with exporting animations from Maya to my own engine using DirectX 11. I export the fbx file with all its content in it. So the problem i have is that the animation dosnt seem to rotate the joints correctly? Please see the attached screenshots. bindpose.png = Frame 1 (first keyframe is at frame 2), the bindpose, no animation applied. frame30.png = Frame 30, rotation applied to two joints. engine.png = Frame 30 of animation in engine, rotation != rotation in Maya I use my custom tool to export data from the fbx file using the fbx sdk. The following is how i extract the skeleton bind pose and inverse bind pose transforms using fbx sdk: (Note: freeze transformation have been applied to the mesh, so i ignore the geometry transform since its just an identity) FbxAMatrix localTransform = p_Node->EvaluateLocalTransform(); joint->m_Location = localTransform.GetT(); joint->m_Scale = localTransform.GetS(); joint->m_Rotation = localTransform.GetQ(); FbxAMatrix inverseBindTransform = p_Node->EvaluateGlobalTransform().Inverse(); joint->m_InverseLocation = inverseBindTransform.GetT(); joint->m_InverseScale = inverseBindTransform.GetS(); joint->m_InverseRotation = inverseBindTransform.GetQ(); Then i extract information about each join for all keyframes, in this example i only sample rotation: for( int i=0; i<rotationCurve->KeyGetCount(); ++i ) { FbxAnimCurveKey key = rotationCurve->KeyGet( i ); FbxTime time = key.GetTime(); FbxAMatrix transform = p_Node->EvaluateLocalTransform( time ); // setup frame JointFrame frame; frame.m_IsRotation = true; frame.m_Frame = time.GetFrameCount( m_AnimFramerate ); frame.m_Rotation = transform.GetQ(); joint->m_RotationKeyframes.add( frame ); } When i look at the rotation values from Maya i see that sometimes the axis of the quaternion is 0,0,0 assuming that the axis is mData[0-2]. So i must be doing something wrong here right? Thats the fbx part. Then in my engine i load the resources. This is how i setup and update the skeleton transforms: (Note: m_Rotation is a quaternion) void pmJoint::computeMatrices( pmJoint * p_Parent ) { if( m_IsDirty ) { pmMath::matrixCreateTransform( &m_LocalTransform, m_Location, m_Scale, m_Rotation ); } if( p_Parent ) { if( p_Parent->m_IsDirty || m_IsDirty ) { m_WorldTransform = m_LocalTransform * p_Parent->m_WorldTransform; m_IsDirty = true; } } else if( m_IsDirty ) { m_WorldTransform = m_LocalTransform; } for( pmUInt32 i=0; i<m_Children.count(); ++i ) { m_Children[ i ]->computeMatrices( this ); } } So as you can see, all bones operate in their localspace using their parents world to update their world. Then to get the render matrices i call this function: void pmJoint::computeRenderMatrices() { m_RenderTransform = m_InversBindTransform * m_WorldTransform; for( pmUInt32 i=0; i<m_Children.count(); ++i ) { m_Children[ i ]->computeRenderMatrices(); } } The animation part is simply lerping and slerping. I get the problem no matter if i interpolate or just show keyframe poses, so i left that code out. Any input, idea or crazy thought is welcome. Im at a loss here.
  9. Thank you so much for taking the time to explain. Learning stuff everyday it seems :)
  10. Dropping support of x86 in favor to x64 might solve a lot of headaches. :wink:     Thank you, i was indeed compiling for x86. I recompiled my source for x64 and with the align directives i now seem to be able to use the "A" notation functions :)   Can you provide an explination to why this change is so significant?
  11.   Thanks for pointing this out. Alignment is something new for me, so im still trying to figure it out to the best of my ability.   So, i have tried allocating using new and also by just putting the Matrix4v4 on the stack, both result in the assertion going of. This is the object im using thats causing the problem. It in turn is allocated using "new Camera()"; class Camera {       Matrix4v4 m_View;     Matrix4v4 m_Projection;     Matrix4v4 m_ViewProjection;     Matrix4v4 m_InversedViewProjection;   public: };
  12. Ah... So i can just use the function XMLoadFloat4x4 instead of XMLoadFloat4x4A. Note the missing "A" at the end.   My problem have been resolved.
  13. Hey   Im having some trouble with the DirectX 11 matrix functions. Not 100%, but maybe 80% of the time im getting the following assertion:   ((uintptr_t)pSource & 0xF) == 0   It happens when i call the function:   XMLoadFloat4x4A   Relevant code class Matrix4v4 { public:     __declspec(align(16)) float m[4][4]; };   void matrixMultiply( Matrix4v4 * p_Result, const Matrix4v4 * p_A, const Matrix4v4 * p_B ) {     using namespace DirectX;     XMMATRIX a = XMLoadFloat4x4A( (const XMFLOAT4X4A *)p_A );     XMMATRIX b = XMLoadFloat4x4A( (const XMFLOAT4X4A *)p_B );     XMMATRIX r = XMMatrixMultiply( a, b );     XMStoreFloat4x4A( (XMFLOAT4X4A *)p_Result, r ); } This must have something to do with the alignment of my data i take it. But the above code is just like they do it in UE4.   I dont know what to do really.. Is it a compiler setting? (Im using vs2015)
  14. Id say for clarity. It sure will make it easier to work with in the long run.       That's not the best example though, since deltaTime is already copied by value (so const here might have some meaning to the programmer such as "there is no reason to ever modify the deltaTime variable inside UpdateWorld" and some people like to do it for this reason, while others think it's ridiculous, but it can't possibly affect the function's behaviour). There is no real consensus on this use of const.   You are correct Bacterius, it was a bad example. Thanks for clarifying.
  15. Hey great work, i just briefly looked over main.cpp and planet.cpp. And what caught my attention from the get go was functions like, SoftCollide, HardCollide, ObjClicked etc etc. Instead of sending in the object you want to operate on you are sending in the index. I would recommend sending in the object directly. So it would look something like this "void SoftCollide(Planet * planet);"   And i would also like to point out the usage of const. I understand it might be a hot topic where each person have his/her own idea of whats best. But id like to suggest to try it out. Use const for input parameters in functions that you know wont change.  Example "void UpdateWorld(const float deltaTime);" For example in your planet constructor you have a int objtypes, thats a perfect case for where it should be const. Const can be abit tricky to see the point of in the beginning. But for me, its really great. It makes the code more clean and it prevents mistakes.