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

Archived

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

Wrathnut

Different way to do 3d rotations?

11 posts in this topic

I''ve been fooling around trying to learn linear algebra so I can understand transformations that do the rotations of an object, now I actually didn''t learn much about it yet.. the book I have is my physics teacher''s, it''s way old. But I got to thinking about it and thought I might be able to solve my problem with spherical coordinates. Anyway to make a long story short I threw together a simple program in java that handle rotating and object by sending it angles then just doing some simple conversions. Courtesy of some very easy to understand calc 2 stuff. My program worked with only one logical error that I am working on fixing. As far as I can tell if optimized there might also be a speed increase in calculations(but only if you have many objects being manipulated). Anyway I was just wondering has anyone ever tried making a 3d engine that performs rotations this way? It''s very very easy to understand doing it this way than to do the complex matrix math I''ve seen used commonly for rotations.
0

Share this post


Link to post
Share on other sites
Not sure if I really understand what it is that you''re doing, but it sound like you''re using quaternions. You can read about them in the resource section here at GameDev.net.
0

Share this post


Link to post
Share on other sites
It sounds like you haven''t implemented rotations around arbitrary axises yet. In that case rotating by Matrices in normal rectangular coordinates is far superior in terms of performance as well as mathematical clarity. Translations by fixed rectangular amounts are also vaguely painful in spherical coordinates in terms of computation time.
0

Share this post


Link to post
Share on other sites
Sounds like you''re using a modified Control Cubes method. I read about the method first on Gamedev.net so the file will be lurking around somewhere. Basically, it uses rectangular co-ordinates but does away with much of the matrix math.



=> Arfa <=
0

Share this post


Link to post
Share on other sites
no I''m not using quaternions, as far as I know.

SiCrane: Yeah I haven''t tried it using an abritrary axis.. Do you happen to know by chance how much of a loss I will take by diong the shperical coordinate conversion?

Afra: do you happen to konw where that article is? I''ve heard people mention something about it when I was going through the post for like the last year or so but I''m not sure what''s about.. The post I read said that it was on gamasutra.com but I scoured that site and couldn''t find it.
0

Share this post


Link to post
Share on other sites
Translations require at least two sins and arcsins per point translated. For a simple object, say a cube, that''s 8 arcsins in a single translation. For rotation around an arbitrary axis, you translate the object to be rotated so that the axis passes through the origin, rotate and then translate back. All in all very computationally expensive in spherical. In matrix transformations, you apply the same transformation matrix to each point. In your spherical transformation you''d have to calculate the translations, rotations and retranslations separately for each point.
0

Share this post


Link to post
Share on other sites
True, but using lookup tables for sin and cos, make it only 2 arcsin per cyc(but I'm working on a workaround for that).. the rest is just multiplication and divisions... Which is the same as doing it with matices.... infact I think it might be close to the same about of work on the cpu, I guess I'll really have to compare code to be certain though.. the pocedure I used was to draw object in cartesian, convert to spherical and and the degree of the angles you wish to rotate and then convert back..

Edited by - Wrathnut on 2/12/00 7:52:37 PM
0

Share this post


Link to post
Share on other sites
In order to keep it on the same order of magnitude for computation time you''ll need look-up tables for both the sins and arcsins. You''ll have problems with granularity in your tables, especially as you move farther away from the origin. Bottom line is that lookup tables aren''t accurate enough for the general case.
0

Share this post


Link to post
Share on other sites
^_^ I''ll take your word SiCrane. I think I''m still going to play around with it till I get the DirectX docs figured though! heheh
0

Share this post


Link to post
Share on other sites
You don''t have to take my word for it. Just think what happens when you try to translate an object 1000 units away from the origin by 1 unit. You''ll need an angle of 0.05729 in your arcsin lookup. Even if you only do multiples of 0.05 that 7200 entries in your lookup table. Then consider that you won''t hit 0.05729 exactly, you''ll be off by 0.00729. You can solve that by interpolating between lookup table values, but then you''ve increased the time complexity of calculation again. The alternative is to increase the granularity of your table until it can handle the 0.057, in which case you''ll probably need a lookup table size of 360,000 entries. If your use 32bit values for your tables then that 1,440,000 bytes in your lookup table. Then you start really having troubles with cache misses, page faults, etc. And you''re still not as accurate as rectangular coordinates with matrix transforms.
0

Share this post


Link to post
Share on other sites
I take it you aren''t the type of guy to try to do something new or different? I am not trying to make a fully formed 3d engine with all of the bells and whistles... Just trying to get it to work (displaying and rotating objects correctly), and also becuase I enjoy trying to figure things out and see if they can be done in a different way. The problems you bring up I can think of addressing in several different ways off the top of my head but I''m not trying to prove anything here I just was wondering if anyone had done it before. ^_^


War doesn''t determine who is right, war determines who is left.
0

Share this post


Link to post
Share on other sites
Actually, I am the kind of guy to try something new and different. I just do enough reading to know that what you''re doing isn''t really new, and I''m just letting you know what pitfalls await you. Using spherical for rotations *has* been done before. It''s just no one has made a full-scale 3d engine out if it, because of the issues I''ve mentioned. I''m not trying to stifle you or anything, as I said, don''t take my word for it, think things through for yourself.
0

Share this post


Link to post
Share on other sites