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

Some clarification about inversing rotation only around particular axes

7 posts in this topic

Suppose, I have a given matrix. I only need to inverse the rotation around z-axis and the rotation around y-axis keeping the rotation around x-axis intact (without any change). I am a bit confused about what changes in unit matrix needed to be done so that if I multiply the given rotation matrix by that unit matrix, I can get the needed transformation.Could anyone give some clarification.

Thanks in advance.
1

Share this post


Link to post
Share on other sites
First you have to define what you mean by "the rotation around z-axis". The answer will probably just contain the algorithm for doing what you want. For instance, if you think of the rotation as being built as the composition of three rotations, first around the x-axis, then around the y-axis and then around the z-axis, the algorithm is to first express the rotation as that type of composition (Google for `rotation matrix to Euler angles', for example), then flip the signs you want, then recompose the rotation matrix.

But chances are you really don't know what you mean by "the rotation around z-axis", because otherwise you would have described it better.

Perhaps you can back up a little and tell us what you are trying to do.
2

Share this post


Link to post
Share on other sites
Thanks for the reply. I understand you are suggesting to decompose the matrix and then negate the corresponding rotation angle and again build the matrix. Is there any way to get that by multiplying the unit reflection matrix?

Thanks again in advance.
0

Share this post


Link to post
Share on other sites
Hello, I would like to know is it possible to get the transformation matrix from a given x, y and z-axis basis vectors. Thanks
0

Share this post


Link to post
Share on other sites
The columns of the transformation matrix are precisely the axis vectors.

By the way, you still haven't told us what you are trying to do that prompted you to start this thread.
1

Share this post


Link to post
Share on other sites
Thank you. I am trying to rotate an object by multiplying with a rotation matrix, but can't find it get right. That's why I was asking whether there is any difference getting transformation from basis vectors.

Actually I have opencv rotation matrix which I need to use for my OpenGL programming.I swapped the rows for columns to get rotation matrix to be used for OpenGL. Now I find the rotation around x axis is inversed. How can I make it correct? I know it is possible to make it correct by manipulating the basis vectors, but I need to know where I am wrong. Please let me know.

How to get the correct rotation matrix from OpenCV to OpenGL? I have posted this topic before but without any clarification.

Please shed some light if you have answer.
0

Share this post


Link to post
Share on other sites
You should probably start by learning a lot of linear algebra.

The math behind 3D graphics gets very intense, very quickly. Usually it requires college level math in the topic called linear algebra.

It is certainly possible to do a small amount of 3D graphics programming without understanding the math, but you will have a hard time creating new things.

As a parallel to finding the math online, you can use pre-packaged containers of ingredients that you mix with specified volumes of water or oil to make food products, or you can learn to cook with real ingredients and learn to adjust the recipes to fit your desires.

The transformation between the two is very small, but you need to follow all the steps exactly. You are trying to make a change to a recipe. You can either ask someone else to make an entirely new recipe for you, or you can learn what all the parts do and understand the change you want to make.

If you intend to do anything more than following a few pre-built formulas you will need an understanding of WHY they do what they do. As you have just discovered, when you try to deviate from the easy-bake formula things can go horribly wrong. You need to understand the reasoning behind it before you can make changes. There are a huge number of good books and web sites out there that can teach you the fundamentals of the math.
2

Share this post


Link to post
Share on other sites
Thanks for the suggestion and sorry for my poor knowledge. Actually I again want to write down some observation. As I said I have an opencv matrix. I would like to convert it to OpenGL matrix. As opencv is row-major, in opengl, I need to store in column-major order. I did that.

Next, Opencv y and z axis need to be reversed too. In order to get back the proper-oriented matrix in OpenGL, I multiplied the matrix with the following unit matrix:

|1 0 0 0|
|0 -1 0 0|
|0 0 -1 0|
|0 0 0 1|

I get the matrix with proper orientation ( I assume), but still with y and z axis vectors reversed. I know if I just inverse the sign of y and z-axis vectors, it will give me the desired result.

My question, what is the standard step of converting an opencv matrix to opengl matrix.
If anyone has done similar work, please let me know.
0

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