• 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.


  • Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About RaidenF8

  • Rank
  1. Thank you guys for the answers. First, I do not agree that the expression "angular_impulse = desired_euler - current_euler;" is wrong math. Because it seems to be working for half of the space. But since you are both emphasizing on this matter, I'm gonna drop it and focus on the quaternion: rotation_amount = desired_quaternion * current_quaternion^-1. I made a youtube video of what is going wrong. Hopefully this would give you guys a better understanding of where the problem might come from. Here, I'm applying angular_impulse by just converting the quaternion that goes from current to desired to euler angles. [media]http://www.youtube.com/watch?v=QwnWyWDx6OI[/media] Also alvar, doing something on the quaternion itself might help, and it sounds interesting. I have also tried to do some stuff with it, but haven't got anything out of it. I haven't tried the log thing you mentioned yet. Would you please tell me how to get x,y,z for the impulse based on the rotation_amount quaternion and doing log? Moreover, impulse or force/torque CAN be used to move from one position/rotation to the other. applyLinearForce is what I am using to change the position of the object while holding it. It is the same technique with current position and desired position, and applying linear impulse based on desired-current to get to the desired position. You can see in the video above that it works very smoothly for the position of the object. It's also working for the rotation but unfortunately only for half of the space. Thanks again, and I appreciate your help [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  2. No, I am not interpolating. I am not trying to get any values between my two quaternions. After I convert my current and desired quaternion to euler angles, I then do: angular_impulse = desired_euler - current_euler; applyAngularImpulse(angular_impulse); If you think I do not have to convert to euler to apply this impulse, then how do you think I can get my angular_impulse based on my current_quaternion and desired_quaternion? Thank you.
  3. Also, this is how I calculate my euler based on the given quaternion q. [code] float q0 = q->getReal(); //w float q1 = q->getImag().getComponent(0); //x float q2 = q->getImag().getComponent(1); //y float q3 = q->getImag().getComponent(2); //z float euler_x = atan2(2.0*(q0*q1+q2*q3),1.0-2.0*(q1*q1 + q2*q2)); float euler_y = asin(2.0*(q0*q2-q3*q1)); float euler_z = atan2(2.0*(q0*q3+q1*q2),1.0-2.0*(q2*q2+q3*q3)); [/code]
  4. Thanks so much for the answer. [list] [*]For ApplyAngularImpulse you are absolutely right, it takes a three dimensional vector. But those three values would have the same effect of roll, pitch, and yaw in the Euler angles, please correct me if I'm wrong about this. [*]About flipping the quaternions, I tried that too. But, the problem doesn't come from there. Let me give you an example of when the computations go wrong: [/list] [b]For the Good Side(the side that works):[/b] [b]When looking all the way up:[/b] [b]desired quaternion:[/b][list] [*]x: 0.623505 [*]y: 0.18474 [*]z: -0.154878 [*]w: 0.743724167 [/list] [b]converted desired euler:[/b][list] [*]x: 1.39539 [*]y: 0.486941 [*]z: 0 [/list] [b]When looking all the way down:[/b] [b]desired quaternion:[/b][list] [*]x: -0.602746 [*]y: 0.265235 [*]z: 0.222362 [*]w: 0.718959987 [/list] [b]converted desired euler:[/b][list] [*]x: -1.39539 [*]y: 0.70685 [*]z: 0 [/list] [b]On the BAD Side:[/b] [b]When looking all the way up:[/b] [b]desired quaternion:[/b][list] [*]x: 0.176007 [*]y: 0.737006 [*]z: -0.617873 [*]w: 0.209943473 [/list] [b]desired euler:[/b][list] [*]x: -1.7462 [*]y: 0.555019 [*]z: 3.14159 [/list] [b]When looking all the way down:[/b] [b]desired quaternion:[/b][list] [*]x: -0.154882 [*]y: 0.743722 [*]z: 0.623505 [*]w: 0.184744284 [/list] [b]converted desired euler: [/b][list] [*]x: 1.7462 [*]y: 0.486954 [*]z: -3.14159 [/list] So on the good size, when I move the cursor from all the way up to all the way down, z remains zero, and x goes from 1.39 to -1.39. So as you see, these values change continuously, there is no gap in between which is fine. However on the bad side, when I move my cursor from all the way up to all the way down, x goes from -1.74 to -3.14(when looking straight). Then it goes from 3.14 to 1.74. So you see that gap of 2*PI when looking straight. z is even worst. When going from all the way up to all the way down, z is constantly jumping(it's either 3.14 or -3.14). I hope this gives you a better understanding of what is going wrong right now. Because of these gaps that I have on the bad side, current euler cannot go to desired euler which makes the object to freak out. It is constantly changing the direction in which to rotate. I would really appreciate it if anyone has a solution for this problem. Thank you.
  5. Thank you for your answer alvaro. But yeah, I have tried that too. So, here is what happens to the desired rotation after I convert to Euler angles: For the half of space that it works: y goes from -PI/2 to PI/2 x goes from (-PI/2 + alpha) (Looking Down) to (PI/2 - alpha) (Looking up) Note that alpha exists because the degree of freedom for the camera is limited as we look all the way downwards or upwards. z is zero For the half of space that it doesn't work: y goes from -PI/2 to PI/2 x goes from (PI/2 + alpha) to PI (This is for looking all the way down to looking straight) and from -PI to (-PI/2 - alpha) (This is for looking straight to looking all the way up) Notice the gap between PI and -PI when looking straight z has the same kind of behavior as x, only that it is even worse and it has much more gaps. It is either -PI or PI. So, now you can see what goes bad when it wants to go from current to desired. Because of the gaps and these inconsistencies, it wouldn't know which direction to go, and then it would freak out. When I say it has a similar problem when converting the quaternion that goes from current to desired into Euler angles, it is because of the fact that these gaps still exist in the converted quaternion. Thank you for your time, I would really appreciate any help.
  6. Hey guys, I am trying to do the object manipulation of the character in the game that I'm currently working on. So, the object should always face the character while it is being carried. In order to this, I can easily set the rotation of the object to the rotation of the character. But Havok physics don't work this way, and whenever there is collision, physics would freak out. In order for physics to work smoothly, I would get the current rotation of the object which is in quaternions. Then I would know my desired rotation in quaternion based on the rotation of the camera, and then I would apply angular impulse to the object in a way that it goes from current quaternion to desired quaternion. The problem here is that ApplyAngularImpulse in havok gets euler angles as argument. So, what I did was that I converted the current and desired quaternions to Euler Angles, and then I substracted them, and applied the agular impulse to the object. (Of course I damped it so that it would stop in the desired rotation). However, this method only works for half of the space. Because when you convert from quaternions to euler angles, for half of the space it changes continiously, but for the other half, there are gaps between different parts of the space. So the object would rotate smoothly on the one half, but on the other, it wouldn't know which way to rotate because of those gaps. I also have tried getting the quaternion that goes from current quaternion to the desired one, and then converting it to euler, and applying angular impulse based on that, but that also has a similar kind of problem. I am really stuck here, and don't know what to do at this point. If anyone can point me in the right direction, I would really appreciate it. Thank you.
  7. Please delete this post, I made it by mistake. Thank you.