• 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.
Sign in to follow this  
Followers 0

Help with getting the change in x,y,z coordinate in 3d space!

2 posts in this topic

Ok I'm making a 3d game and my problem is that I wanted to get what will be the new x,y,z coordinate depending on the rotation of the parent bone...see the image below for better understanding... see in fig a the parent bone(B) and child bone(A) both share the same x and y, and rotated at 0...Now in figure b,see the parent bone rotates 45 degree in let say y coordinate,now I found out how to get the new x based on the given side and angle with this formula: newx = tan(yrot)xlength of the parent bone...But suddenly I realized that not only rotation in y affects the x coordinate BUT also if you rotate it on z axis...Now I'm confused what to do to relate that z rotation on my formula...I hope you understand what the problem is...And if someone can help me...These are the given so far:location of parent bone(B)let's say 0,0,30 and location of the child bone 0,0,15 and the angle that was formed 45 degree and lastly we know what is the length of the bones 10x2...PLEASE HELP!!!emoticon-0121-angry.gifxyzog.png


Share this post

Link to post
Share on other sites

You should get familiar with linear algebra. This becomes a fairly trivial with vectors and matrices.

Each bone can simply be defined as having location in the coordinate frame of its parent bone and a transformation that this bone applies. That will uniquely define the entire bone structure. In addition to that, you can add any information you want to the bones, of course.

Your choice of bone names is a little bit off for the sake of explaining the situation and to extend the explanation to more bones, so let's say instead that bone A is the first bone, bone B is attached to bone A, and bone C is attached to bone B, and so on. Each bone has a position p (a vector) and an orientation R (a rotation matrix). Let's say that each bone also has a translation matrix T that simply corresponds to a translation matrix by its position p. For example, A.R is the rotation matrix of bone A, and B.T is the translation matrix for bone B, and so on.

At this point, finding the orientation and location of any bone in an arbitrary chain of bones becomes fairly trivial. To determine a bone's parent transformations, you simply multiply all its parent transformations.

  • The bone A is the parent bone and is thus not subject to any prior transformations. Its location is A.p and its orientation is A.R, so you can use these matrices to draw the bone itself.
  • The bone B has the bone A as its parent. Its location is B.p in A's coordinate frame, and so its location becomes (A.T * A.R) * B.p.
  • The bone C has the bone B as its parent. Its location is C.p in B's coordinate frame, and so its location becomes ((A.T * A.R) * B.T * B.R) * C.p.
  • The bone D has the bone C as its parent. Its location is D.p in C's coordinate frame, and so its location becomes (((A.T * A.R) * B.T * B.R) * C.T * C.R) * D.p.
  • And so on...

In your case, you would have defined the bones as follows:

  • A.p = (0,0,30)
  • A.R = rotation matrix of 45 degrees
  • B.p = (0,0,15)
  • B.R = rotation matrix of 0 degrees

Note that bone B (which is bone A in your picture) does not have any rotation on its own; its rotation comes from its parent bone A (bone B in your picture).

Note that, depending on which conventions you choose for your linear algebra, you may have to change the order of the translation and the rotation matrices, multiply child bones on the left side, and/or multiply the position vector on the left side instead.

Ok thanks for the info,Trying Linear Algebra now thanks.

EDIT:it's now make sense,I'm learning from it thanks....


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0