Jump to content

  • Log In with Google      Sign In   
  • Create Account

eedok

Member Since 15 Sep 2003
Offline Last Active Apr 26 2014 09:52 AM

Topics I've Started

RIP Torque and Gamebryo

11 November 2010 - 08:45 AM

Sources:
Emergent Technologies to Liquidate Assets
Instant Action winding down operations

Could kind of see why both of these are going down, Bethesda was a big customer for Gamebryo, but since the Id Buyout I don't see them buying out a company then not using the engine, and I can't really think of many other companies that were big customers for Gamebryo

As for Torque, the time I thought it was done was when Unity launched for windows and my Unity proficiency surpassed my Torque proficiency during the trial of Unity, whereas I had several months in Torque and instead of them pushing to make Torque easier to understand/use they went forward with creating more SKU's instead.

Weird to see 2 engines go so close together though

Separating Axis Problem(not working on non-AABB)

04 November 2009 - 10:06 AM

I have 2 collision poly's as defined as such:
package
{
	import flash.geom.Point;
	public class CollisionPoly
	{
		public var points:Array;
		public var edges:Array;
		
		public function CollisionPoly(vertexes:Array):void
		{
			this.points = vertexes;
			this.edges = new Array();
			for(var i:Number = 0; i < points.length; i++)
			{
				var p:Point = points[i];
				var nextPoint:Point = points[(i + 1) % points.length];
				edges[edges.length] = p.subtract(nextPoint);
			}
		}
		
		public function projectToAxis(axis:Point):Projection
		{
			var min:Number = int.MAX_VALUE;
			var max:Number = -int.MAX_VALUE;
			
			for(var i:Number = 0; i < points.length; i++)
			{
				var p:Point = points[i];
				var dotProduct:Number = (p.x * axis.x) + (p.y * axis.y);
				if(dotProduct < min)
					min = dotProduct;
				if(dotProduct > max)
					max = dotProduct;
			}
			
			return new Projection(min,max);
		}
		
		public function intersects(c:CollisionPoly):Boolean
		{
			var allEdges:Array = new Array();
			for(var i:Number = 0; i < edges.length; i++)
			{
				allEdges[i] = edges[i];
			}
			for(var j:Number = 0; j < c.edges.length; j++)
			{
				allEdges[j + i] = c.edges[j];
			}
			for(i = 0; i < allEdges.length; i++)
			{
				var edge:Point = allEdges[i];
				var axis:Point = edge.clone();
				axis.normalize(1);
				//Make perpendicular
				var tempx:Number = -axis.y;
				axis.y = axis.x;
				axis.y = tempx;
				
				var projection:Projection = projectToAxis(axis);
				var cProjection:Projection = c.projectToAxis(axis);
				if(!projection.intersects(cProjection))
					return false;
			}
			return true;
		}
	}
}



I have 2 collision poly's for isometric diamonds that this code is incorrectly identifying as intersecting

the first poly is at [[84,0],[124,20],[84,40],[44,20]]
and the second is at [[40,25],[80,45],[40,65],[0,45]]

as shown in this picture it's showing as colliding when it's not


I've stepped through the code and I can't find where in the intersects function it's going wrong, so I'm crying halp here

link to the demo if it helps(click & drag the shapes)

[java] Converting wav's to mp3's

29 September 2009 - 07:55 AM

I'm trying to make a tool to convert wav's to mp3's then send out a notification when it's done. (The wav's will always be 44100Hz 16-bit Stereo files) My first attempt was to link to JMF then attempt to do this:
	public void wavToMP3(String waveFileName, String mp3FileName) throws Exception
	{
		File file = new File(waveFileName);
		AudioInputStream in = AudioSystem.getAudioInputStream(file);
		AudioInputStream out;
		AudioFormat.Encoding encodedFormat = new AudioFormat.Encoding(javax.media.format.AudioFormat.MPEGLAYER3);
		out = AudioSystem.getAudioInputStream(encodedFormat, in);
		File outfile = new File(mp3FileName);
		AudioSystem.write(out, new AudioFileFormat.Type("MP3","mp3"), outfile);
	}

but that results in this error: Exception in thread "main" java.lang.IllegalArgumentException: Unsupported conversion: mpeglayer3 from PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian I can't seem to find what I need to change to fix this, any suggestions?

[java] Java equivelant to AS3's sound.extract()?

31 August 2009 - 10:48 AM

I'm trying to port some Actionscript code to Java, and I'm looking for a way to get an array of frequencies in a format where it's 1 float per sample per channel and there's 2 channels from an mp3 file. Anyone have an example available on how to accomplish this?

[.net] Speed up GDI drawing?

12 August 2009 - 03:08 PM

EDIT: Forgot to mention I'm using .NET Compact Framework 3.5 I'm trying to make a pixel editor where when you zoom in on the pixels it looks like this: I've got this looking right but it bogs down the performance of the application by a lot for even small images/scale factors:
        public void updateDrawing()
        {
            Rectangle r = new Rectangle(0, 0, scaleFactor - 2, scaleFactor - 2);
            g2.Clear(Color.White);
            Color c = image.GetPixel(0, 0);
            for (int y = 0; y < image.Height; y++)
            {
                for (int x = 0; x < image.Width; x++)
                {
                    scaledBrush.Color = image.GetPixel(x, y);
                    r.X = x * scaleFactor + 1;
                    r.Y = y * scaleFactor + 1;
                    g2.FillRectangle(scaledBrush, r);
                }
            }
            DrawingArea.Refresh();
        }



image is the original unscaled image, g2 is a reference to the graphics handle of the scaled image(a bitmap), and DrawingArea is a picturebox which displays the scaled Image The code gets caught up most in the combination of the GetPixel and FillRectangle calls, is there any way to speed these up? [Edited by - eedok on August 13, 2009 10:49:52 AM]

PARTNERS