Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Dec 2002
Offline Last Active Nov 23 2013 03:34 PM

Posts I've Made

In Topic: Post Mortem on 4x Strategy Games

03 October 2013 - 05:29 PM

What I dislike about most 4X games is that mandatory expansionist mentality. Take all faster = win. Leaving the unlucky players that spawned in less expansible territories to their inevitable doom. Spawning on a stranded islands in Civilization calls for a restart.


I'm trying to fight that mentality in my own 4X game by balancing quantity and quality. A higher developed sectors will yield as much benefits as several underdeveloped sectors. In the end, having more undeveloped sectors might be too risky as they will be much easier to lose.

In Topic: Rotate a 4-vev plane to be aligned with to a vector

19 April 2013 - 07:26 PM

it is done by setting your matrix axes oriented in the direction you need using crossproducts.

dirWant : the direction to align to, normalized.

ref: a reference vector for 3D alignment. Could be set to (0,1,0)


a = normalize(crossProduct(dirWant, ref));

b = crossproduct(a, dirWant);

c = dirWant;



Then you set your matrix like so if your vertices are on the Z plane:

a.x  b.x  c.x  t.x
a.y  b.y  c.y  t.y
a.z  b.z  c.z  t.z
0    0    0    1


t being your particle position.


Note that if dirWant == ref vector, it won't work. So choose another ref if they are equals.


Hope that help!

In Topic: Ray to Ray intersection

11 April 2013 - 01:27 PM

You need to find the shortest distance between the 2 rays.

look at "Distance between lines, rays, and segments (3D)." on http://www.geometrictools.com/LibMathematics/Distance/Distance.html

There is everything you need there. :)


Hope that help!


In Topic: bi-quadratic interpolation?

11 April 2013 - 01:09 PM

You might want to take a look at the generalization of Bézier Curves : http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Generalization

You can do interpolation to any degree.

In Topic: Object detection

11 April 2013 - 12:54 PM

In my collision system I did something like this:

class Capsule3D{
    //data for capsule object
class Sphere3D{
    //data for sphere object
Class IColPrimitive{
    virtual TestResult test(const IColPrimitive& aOther)const=0;
    virtual TestResult test(const Capsul3D& aPrim)const=0;
    virtual TestResult test(const Sphere3D& aPrim)const=0;

class Capsule3DColPrim : public IColPrimitive{
    virtual TestResult test(const IColPrimitive& aOther)const{
        return aOther.test(mCapsule);
    virtual TestResult test(const Capsul3D& aPrim)const{
        Actual test code using mCapsule and aPrim
    virtual TestResult test(const Sphere3D& aPrim)const{
        Actual test code using mCapsule and aPrim
    Capsul3D mCapsule;

class Sphere3DColPrim : public IColPrimitive{
    //similar to Capsule3DColPrim
    Sphere3D mSphere;

Then you just have to call a_IColPrimitive.test( another_IColPrimitive );


I believe this is the Bridge design pattern but I might be mistaken on this.
Hope that help!