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


This topic is now archived and is closed to further replies.


3D math problem

3 posts in this topic

Hi people. I have the following problem: Imagine a starship looking straight ahead. straight is into the Z axis, up is the Y. If I wanted to turn the ship left or right I would rotate it around the Y axis. OK. Now if this ship would be facing up towards the Y axis, turning left/right would mean rotating along the Z. And if it was in between.... I know I can find the vector to rotate around using simple transformation matrices, but does anyone know how I get the new angles I need? All my 3D objects have absolute (to the axes) angles. How do I know which angles to change when I want the ship "up 3 degrees" or "left 5 degrees"? Thanx in advance! -------------------- so, what you''''re saying is, that the mushroom spores were brought in from outer space by - who?? -cosmosis

Share this post

Link to post
Share on other sites
I''ve been confronted to the same problem
You should have a look to C Hecker Tutorials
My Math knowledge doesn''t permitt me to explain you, but
there you should find what you need :
I Hope you''re motivated cause it''s kinda pretty hard stuff

Share this post

Link to post
Share on other sites
Another usefull info
You should read the whole 4 tutz on rigid body dynamics, but
the tutorial you need is the 4th

Share this post

Link to post
Share on other sites
This might help...

Keep track of the current up, look, and right vectors of the ship. When you need to pitch up rotate by these axis.

Be sure to normalize and true these axises by each other after rotating them, by doing something like this:

// cross product of Up and Look vectors
m_vRight = GVector3CrossProduct(m_vUp, m_vLook);
m_vRight = GVector3Normalize(m_vRight);

// cross product of Look and Right vectors
m_vUp = GVector3CrossProduct(m_vLook, m_vRight);
m_vUp = GVector3Normalize(m_vUp);

You can get the full transform to align the ships vectors with the world space by the following:

// Right to x axis
matTransform._11 = m_vRight.x;
matTransform._21 = m_vRight.y;
matTransform._31 = m_vRight.z;
matTransform._41 = 0;

// Up to y axis
matTransform._12 = m_vUp.x;
matTransform._22 = m_vUp.y;
matTransform._32 = m_vUp.z;
matTransform._42 = 0;

// Look to z axis
matTransform._13 = m_vLook.x;
matTransform._23 = m_vLook.y;
matTransform._33 = m_vLook.z;
matTransform._43 = 0;

// complete the matrix
matTransform._14 = 0;
matTransform._24 = 0;
matTransform._34 = 0;
matTransform._44 = 1;

So the whole thing would go like this:
1. Do the above transform to the axises to temporally align the ship with the world axises.
2. Rotate the axises as you would normally do.
3. Use the transpose matrix of the first matrix transform to get back to actual world coordinates for the axises.
4. Do this for each axis. Then normalize and true the axises.

To display the ship or view from the ship apply the transpose of the above transform (using the current ship’s vectors to calculate the transform).


Share this post

Link to post
Share on other sites