Jump to content

  • Log In with Google      Sign In   
  • Create Account


Normalized

Member Since 18 Oct 2011
Offline Last Active Nov 16 2013 06:55 PM
-----

Topics I've Started

Matching rotations between cameras with different FOV

13 November 2013 - 09:42 PM

I render my sky box with a separate camera with a field of view of 60 degrees. The rest of the game is rendered with a separate camera with a variable field of view with can be as low as 2 degrees.

 

The problem is that the amount of rotation needed make the sky box matchup with the lower field of view camera's  rotation is different. For example say you want to aim at a cloud with mouse look. The amount of rotation you need to apply to the skybox camera is not equivalent to the amount applied to the camera with the lower FOV.

 

Any ideas?


Best networking architecture of this game type

20 January 2012 - 08:28 PM

I am working on a hybrid RTS / third person shooter.

Up to 10 players 5 vs. 5

Each player can control up to 12 physics based vehicles and 132 kinematic infantry. Most like alot less.

I need to pick the architecture

a: trusted client with checking
b: authoritative server
c: P2P full synchronized.

I know most RTS game are full synchronized however, I do not think this will work well for me due to the physics I use etc may not be deterministic. Some of my physics including damage physics and AI may not be lightweight.

Thanks.

Is there a better way to do this?

15 January 2012 - 01:46 PM

I have been working on trying to get an implementation of reciprocal obstacle avoidance working.

I need to find the point tangent to a circle from the origin (0,0). I know how to do this using two circles kind of like the diagram below. I was planning to us the quadratic equation to find the two tangents points.
http://www.nvcc.edu/home/tstreilein/constructions/Circle/circle5.htm
I need both tangent points
I know
1: circle center
2: radius
3: And that the tangent points must pass through the origin (0,0).
I have not used much trig in many years. Is there a better trigonometry based way? I know how to find the lengths of all sides and the interior angles. But not how to find the tangent points.

What is a clockwise ordering

13 December 2011 - 01:47 AM

I have three unordered points and I want to find the normal. I need to get them into a clockwise ordering because I use a left hand coordinate system

My question is what is a clockwise ordering. How do you know if one point is more clockwise then another point?

I know what it looks like in my head but I wonder what is a good algorithm? All my point will be in quadrant 1. I also know the points are not collinear .

Optimizations for projective shadow / fog of war

20 October 2011 - 02:49 AM

I have been working on a fog of war system. Right now, Icreate a texture dynamically then use an orthographic projection. I have it directly sized to the map where 1 pixel equals 1 meter. I pass the texture tothe shader by encoding it only into an alpha channel using an alpha8 texture.

its slow right now it's taking 56ms a frame downfrom 420ms but still too high.


I have attached the code to give you an idea of what I amdoing. Admittedly, I could use a smaller texture and lose the 1 to 1relationship but does anyone have another ideas?


Posted Image

Uploaded with ImageShack.us

[code=auto:0] tags seem broken??/?

what I do


int xLength = myTexture2D.width; int yCounter = 0; int xCounter = 0;
for (int i = 0; i < colors.Length; ++i)

{
colors[i].a = 0.0F;
//clear
if (i / (yCounter + 1) == xLength)

{
++yCounter;
xCounter = 0;
}
else
{
++xCounter;
}
for (int i2 = 0; i2 < testArray.Length; ++i2)
{

//float luminanceTest = ;//0.299F * colors[i].r + 0.587F * colors[i].g + 0.114F * colors[i].b;
if (colors[i].a < testArray[i2].Luminance)
{
if (testArray[i2].MaxX >= xCounter && testArray[i2].MaxY >= yCounter && testArray[i2].MinX <= xCounter && testArray[i2].MinY <= yCounter)
{
Vector2 testPos = new Vector2(xCounter, yCounter);
if ((testPos - testArray[i2].Position).sqrMagnitude < (Mathf.Pow(testArray[i2].Length, 2.0F)) &&
Vector2.Angle(testArray[i2].ForwardDirection, (testPos - testArray[i2].Position).normalized) <= testArray[i2].ArcLengthDegrees)
{
colors[i].a = testArray[i2].Luminance;
}

}

}

}

}







and the data I use for each cone

public struct SightTestCase

{



public readonly float Length;

public readonly float ArcLengthDegrees;

public readonly int MinX;

public readonly int MinY;

public readonly int MaxX;

public readonly int MaxY;

public readonly Color AreaColor;

public readonly float Luminance;

//public readonly float GrayScale;

public readonly Vector2 Position;

public readonly Vector2 ForwardDirection;

public SightTestCase(Vector2 position, Vector2 forwardDirection, int minX, int minY, int maxX, int maxY, Color myColor, float length, float arcLengthDegrees)

{



this.Length = length;

this.ArcLengthDegrees = arcLengthDegrees;

this.MinX = minX;

this.MinY = minY;

this.MaxX = maxX;

this.MaxY = maxY;

this.AreaColor = myColor;

this.Position = position;

this.ForwardDirection = forwardDirection;

this.Luminance = 0.299F * myColor.r + 0.587F * myColor.g + 0.114F * myColor.b - LinearMath.Epsilon;

//this.GrayScale = myColor.grayscale;

}

}


PARTNERS