• 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

814 Good

About quasar3d

  • Rank
  1. Are you sure those equations are correct? All 3 terms in each line are the same, so the first line is actually equivalent to 3 * (x - y)^2 = 2.   Besides that, I think it might be easier to let   a = x - y b = y - z c = a + b   Then   3a^2 = 2 3b^2 = 2 3(a + b)^2 = 2   So it doesn't have any solutions, since a, b = +/- sqrt(2 / 3), but these don't solve the 3rd equation.
  2.   What do you mean with that? They're each others dual, and in memory, they're often stored in the exact same way.
  3. Alvaro's method does require that your polyhedron is represented as a triangle mesh, but if I understand you correctly, you only have a set of points, which lie on the boundary. This means that before you can use it, you'd have to create a triangle mesh from those points, which is possible, but really quite difficult (search for surface reconstruction from point clouds). If you don't mind using third party libraries, you could use CGAL for this though (see http://doc.cgal.org/latest/Surface_reconstruction_points_3/).
  4. If it's a regular octahedron, just take the absolute value of each coordinate, add them, and see if the resulting value is less than a certain threshold (ie. the size of your octahedron). If so, then your point lies inside it, otherwise not.
  5.   The reason why the error gets so big, is that the inverse cosine function is very steep around 1. This has the effect that the (even exact) inverse cosine of a dot product which is only a tiny bit off, will give a pretty big angle difference.   For example, the cosine of 0.1 degree is 0.99999847691, and so if your dot product would give 0.99999847691 (which is a pretty good approximation of 1), the angle you get will be around 0.1   I bet that the reason why, after renormalizing your quaternions, you did get the correct result, was that this gave a dot product of exactly 1, but I don't think this will work for all quaternions. There will certainly be normalized quaternions, which give a dot product with themselves not exactly equal to 1.   The good news is that it's only this bad when you're computing the angle between quaternions which are almost parallel. For quaternions which are not nearly parallel, the result will be more accurate.
  6. What you want is http://en.wikipedia.org/wiki/Boolean_operations_on_polygons with the union operations. It's definitely not an easy thing to implement though, so if you can find a way to do without this, it's probably preferable.
  7. But after Gaussian elimination, the elements in d,g,h are 0, and so all terms in aei + bfg + cdh - hfa - idb - gec vanish, except for aei. But indeed, for 3x3 matrices it's probably still faster to compute it using your formula, but the number of terms in that closed form is n!, with each term consisting of n factors (where n is the number of dimensions), so the complexity grows much faster than with gaussian elimination, where after bringing your matrix to reduced form, always just a single term remains.    The reason they put a negative sign before the determinant was probably because they did an odd number of row exchanges. Each time you exchange rows, the sign of the determinant changes.
  8. Another important reason is of course that you usually combine the translation, rotation, and any other transformations into a single matrix which you use to transform your points. So indeed, it's usual to use quaternions while animating, but once you have determined the transformation for a mesh, you create a matrix, and use that matrix to transform its vertices.
  9. An easy way to get a hang of 3D homogeneous coordinates (which consist of 4 coordinates) is to see them as a higher dimension analogue to fractions.   - A fraction $a/b$ represents a number on the 1D real axis, but really consists of 2 "coordinates", ie. (a,b). In a similar way, the 3D vector (x/w,y/w,z/w) corresponds to the 4D homogeneous vector (x,y,z,w). - Just as with fractions, multiplying all components by the same value doesn't change its value, ie. a/b = (sa)/(sb), or in coordinate form (a,b) = (sa,sb), for some scalar s. Similarly, since (x/w,y/w,z/w) = ((sx)/(sw),(sy)/(sw),(sz)/(sw)), the homogeneous vectors (x,y,z,w) and (sx,sy,sz,sw) are considered the same vector.    And then it just so happens that many operations on 3D vectors can be done much more elegantly on their homogeneous representation, most importantly, transformations like translation and projection become representable by just a matrix. Since for a 4x4 matrix a 4D vector and a scalar s, A(sx) = s(Ax), multiplying a homogeneous vector by a matrix is well defined, ie. if two vectors are equivalent (they represent the same 3D point, even while their 4D representation may be different), they will still be equivalent after they're multiplied with a matrix.
  10. Checking if lengths are multiplictive (ie. the length of a product is equal to the product of the lengths) is actually a very good way to check if your quaternion multiplication works well (if it's multiplicative, your multiplication code is either correct or very wrong, but not a little bit wrong:)). So this was already quite a hint that there was a problem with your multiplication.   Note that for any quaternion a * conj(a) gives the square euclidean length, and so   |a * b|^2 = a * b * conj(a * b) = a * (b * conj(b)) * conj(a) = a * |b|^2 * conj(a) = a * conj(a) * |b|^2 = |a|^2 * |b|^2
  11.      I actually experienced floating-point determinism being varied across machines in an engine which 'planted' trees around terrain at game load time using a procedural method of creating potential points all over the terrain and checking the slope of the ground at those points one at a time before generating a new point to test, and in some cases it would throw off the scene generation algorithm so wildly that the two machines in the same game would be in two geometrically different worlds due to the PRN code becoming out of sync when some trees would get planted and others wouldn't based on floating point precision nuances in the slope check.   If both were running the same executable, then this really can't happen. The result of a floating point instruction is defined exactly (the rule is that it should return the nearest floating point number to the exact result, and round to even on ties). Also, if you don't have options like fast math enabled, then the same thing is true for C/C++ code (at least if it's IEEE 754 compliant), so it's likely that this difference was caused by something else.
  12. This is exactly what least squares solves.
  13. First hit on google for "computer vision book" gives<br /><br />http://szeliski.org/Book/<br /><br />where you can download a pdf for free!
  14. There's indeed a most natural rotation. It's the one that leaves vectors perpendicular to the plane of A and B invariant. To derive such a matrix, note that any composition of 2 (or any even number of) reflections is a rotation. With this, you can easily construct a matrix that satisfies your requirements. Let S_1 be the matrix that reflects A to -A, and let S_2 be the matrix that reflects A + B to -(A + B). The composition S_2 S_1 is then your rotation matrix. In vectors, reflecting a vector x in a normal vector n is {eqn} x' = x - 2 n (n \cdot x) {/eqn} or in matrix notation, where vectors are column vectors {eqn} x' = x - n (n^T x) = (I - n n^T) x {/eqn} so your reflection matrix is then {eqn} I - n n^T {/eqn} so your rotation matrix, which rotates a to b {eqn} R = (I - \frac{(a + b) (a + b)^T}{|a + b|^2)(I + \frac{a a^T}{|a|^2}) {/eqn} EDIT: Can't get latex to work
  15. I once implemented this algorithm: [url="http://www.cs.ucdavis.edu/~amenta/pubs/sm.pdf"]http://www.cs.ucdavi...nta/pubs/sm.pdf[/url] and it worked quite well (although it was far from real time). I haven't implemented other algorithms, so I can't tell you how it compares to other methods. Just do a google search for surface reconstruction, which should give you loads of papers about it.