• Create Account

Banner advertising on our site currently available from just \$5!

# Coz

Member Since 06 Nov 2002
Offline Last Active Feb 26 2011 12:31 AM

### Quaternion rotations

24 March 2010 - 08:38 AM

I have no problem at using a single Quaternion to rotate a point, or with interpolating between two quaternions. I think about Quaternions as some sort of axis-angle rotation. However, handling axis separately is difficult for me. For example, I have a floating character that is looking in a direction. For this I just rotated the character around the Y-axis, since the character should keep it's feet down and face up, so the rotation angle around the X and Z axis are be 0. Now, presume that something applies torque to the character. Now my character has to correct it's orientation by applying torque to look in that direction, and it's what I'm having problems with. I can't just override the orientation instead of applying torque, because then the character's orientation won't interact with any incoming forces during that time. And this torque is represented by a XYZ vector. I converted the quaternion's Y-axis rotation to Euler and this works fine, even thought there might be a less complex and computationally-intensive way. Now, should I do the same for the X and Z axis? what's the best way to extract the rotations around each axis while keeping this function fast?

### gltexgen & texture matrix celshading

20 April 2009 - 02:36 AM

Hi all, I have been trying to apply cel shading( no outlines needed ) to a model, but I'm limited to the fixed function pipeline. I know this can be achieved with glTexGen, and in fact, using a 1D texture( dark to white ) with a GL_SPHERE_MAP works fine, except that the light source is always to the right. If I understand correctly, I could use GL_NORMAL_MAP with glTexGen, then use a texture matrix that contains the light vector in the first row and that should result in the dot product, which would be set as the X coordinate for the texture. However, I have tried this and other variants without success. The closest I could get is that it seems that by scaling the X axis and by rotationg around the Z axis I can move the texture around in directions I want. I tried using a matrix like this as my texture matrix: X Y Z 0 0 1 0 0 0 0 1 0 0 0 0 1 and I'm assuming the light vector is normalized, so if I wanted a light that comes from the sky, Y = -1, so I would use: 0 -1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 and yeah, it doesn't works :p If I could at least get a working example of what I'm trying to achieve, it would be just dandy.

### About source code/media repository directories

14 May 2007 - 10:38 PM

I am working on an open source game, and we want to add a new directory to the SVN repository that contains the source media, that is, the working files(for example, for images, they would be in GIMP's or Photoshop native formats). The issue is that we have two options: #1 /trunk - for everything but the source media /media - for the source media and #2 /trunk/<project's name> - for everything but source media /trunk/media - for source media The approach #2 seems obviously better, but there two problems with it: - Everyone that has a done a checkout to this point has /trunk as their root directory. It concerns not only developers, but the users and packagers of the Linux distributions. - The website that hosts the repository and developer interface has instructions to download from /trunk to get the files in the repository, and we cannot change these instructions. This won't be transitory, and the source media is as big as the rest of the repository, together they could be around 160 megabytes. However, approach #1 has one big problem: artists that do a checkout, won't get the /media directory, and probably will work using the media meant to be used in the game, not to be edited, and it's even worse if they do it on their own then appear suddenly with improved art. Given only those two choices, which one would you pick as a manager for your own project, and which one would you like better as a programmer/artist?

### GL_LINE_LOOP closes early

30 November 2006 - 08:23 AM

Hi! I'm trying to draw a track's borders using GL_LINE_LOOP, and everything seems to be fine, except for one weird problem: You can see the lines going back to the first point of the line loop, as if it was closing. At first I was thinking there was some sort of limit on the number of vertices a line loop can have, but then I found that there isn't any limit. Another detail of this is that it might have to do with my videocard, a Geforce4 mx 440, because on other machines tested (not by me thought) this problem doesn't appears. Also, this problem only appears if I have enabled GL_LINE_SMOOTH, and it seems that the more vertices the line loop has, the more problems it gives; out of all the track maps, only a few ones have this problem. Any ideas?

### Random encounters with hard to beat foes

28 June 2006 - 08:48 AM

Suppose there is a game with two kinds of enemies, the ones who appear most of the time and are easy to beat, always in packs with similar behavior and give a very very small reward, *and* the rare hard ones which should be avoided to stay alive, but their defeat means great rewards(each one of these being worth more than 1 million times than the first kind), each one of these with different behavior and abilities. Suppose allies exist, and look different from common enemies, and giving 10 times the rewards of the common enemies without the risk. Suppose that none of these has to be found, instead they find you. Suppose that the hard enemies can look like the first kind of enemies or like your allies, and only when they attack you can see the difference between an ally or a common enemy and a hard one. How it feels not knowing when an ally isn't one really? which kind of enemy would you like to fight more? would you be afraid of the hard enemies? What would you do if both kinds of enemies are together at the same time? How do you think other players will react?

PARTNERS