Insight VR

Archive for December, 2009

Fastest App Approval Ever?

by john on Dec.30, 2009, under Uncategorized

I submitted Battle for Vesta to the App Store on Dec 23, which is also the day that iTunesConnect went down for the holidays. It came back up on Dec 28 and the game was approved pretty much as the site came back up. That’s 5 calendar days, which is impressive, but it is also basically zero working days, which is unheard of.

I’ve just submitted a 1.0.1 update, we’ll see how long that takes to process.

Leave a Comment :, , , more...


Battle for Vesta – Live on the App Store

by john on Dec.28, 2009, under iPhone

Battle for Vesta is now for sale on the App Store for $1.99. I suggest that you buy it. And tell all your friends to buy it. Seriously. Two bucks is cheap, and the game is great.

Also, www.BattleforVesta.com is live now. Link to it.

Leave a Comment :, , , , , more...

iPhone Game: Video of Actual Gameplay

by john on Dec.04, 2009, under Uncategorized

Ok, here’s what the game looks like on an actual device.

iPhone Game: 3D Space Combat beta 4 from InsightVR on Vimeo.

Leave a Comment :, , , , more...

An OpenGLES Vector Alphabet for iPhone

by john on Dec.02, 2009, under Uncategorized

For my game it would be nice to have some very vector looking text, so I’ve ported the display list based code that I had for such a font to OpenGLES. Note that the letter Q is not implemented, nor are any numbers or punctuation other than spaces at this time.

To use it call initFonts() once (it calculates offsets so that you don’t have to do that by hand if you decide to change the font around) and then call drawString with your desired text in all caps.

It is quick, dirty, and it works for what I need.

So without further ado, here’s the code, I hope that it is useful to you:

#include <string.h>

#include <OpenGLES/EAGL.h>
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>

#include "VectorFont.h"

#define STR_HEIGHT 20
#define STR_WIDTH 10
#define STR_SPACE 30

// GL Primitive, index, length

int letterInfo[][3]=
{
	{GL_LINE_STRIP, 7, 0},  //a
	{GL_LINE_STRIP, 10, 0}, //b
	{GL_LINE_STRIP, 4, 0}, //c
	{GL_LINE_STRIP, 7, 0}, //d
	{GL_LINE_STRIP, 7, 0}, //e
	{GL_LINE_STRIP, 6, 0}, //f
	{GL_LINE_STRIP, 6, 0}, //g
	{GL_LINE_STRIP, 6, 0}, //h
	{GL_LINE_STRIP, 6, 0}, //i
	{GL_LINE_STRIP, 4, 0}, //j
	{GL_LINES, 6, 0}, //k
	{GL_LINE_STRIP, 3, 0}, //l
	{GL_LINE_STRIP, 5, 0}, //M
	{GL_LINE_STRIP, 4, 0}, //n
	{GL_LINE_LOOP, 4, 0}, //o
	{GL_LINE_STRIP, 5, 0}, //p
	{GL_LINE_STRIP, 0, 0}, //q  Q is not implemented!!!
	{GL_LINE_STRIP, 7, 0}, //r
	{GL_LINE_STRIP, 6, 0}, //s
	{GL_LINE_STRIP, 4, 0}, //t
	{GL_LINE_STRIP, 4, 0}, //u
	{GL_LINE_STRIP, 3, 0}, //v
	{GL_LINE_STRIP, 5, 0}, //w
	{GL_LINES, 4, 0}, //x
	{GL_LINE_STRIP, 5, 0}, //y
	{GL_LINE_STRIP, 4, 0}, //z
	{GL_LINE_STRIP, 0, 0} // [ is a space?
};

static GLfloat rawData[]=
{
	// A
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,0,0,STR_HEIGHT,STR_WIDTH,0,STR_WIDTH,-STR_HEIGHT,STR_WIDTH,0,-STR_WIDTH,0,

	// B

	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,0,STR_HEIGHT,STR_WIDTH,.5*STR_HEIGHT,0,0,-STR_WIDTH,0,0,0,STR_WIDTH,-.5*STR_HEIGHT,0,-STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,

	// 'C'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	// 'D'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,0,STR_HEIGHT,STR_WIDTH,.5*STR_HEIGHT,STR_WIDTH,-.5*STR_HEIGHT,0,-STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,

	//  'E'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,-STR_WIDTH, 0,STR_WIDTH,0,-STR_WIDTH,0,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	//  'F'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,-STR_WIDTH, 0,STR_WIDTH,0,-STR_WIDTH,0,-STR_WIDTH,-STR_HEIGHT,

	// 'G'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,STR_WIDTH,0,0,0,

	// 'H'
	-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,0,STR_WIDTH,0,STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	// 'I'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,0,STR_HEIGHT,0,-STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	// 'J'
	STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,0,

	// 'K'
	-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,STR_HEIGHT,-STR_WIDTH,0,-STR_WIDTH,0,STR_WIDTH,-STR_HEIGHT,

	// 'L'
	-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	// 'M'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,0,0,STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	//  'N'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,STR_WIDTH,STR_HEIGHT,

	// 'O'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,

	//  'P'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,STR_WIDTH,STR_HEIGHT,STR_WIDTH,0,-STR_WIDTH,0,

	//  'R'
	-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,STR_WIDTH,STR_HEIGHT,STR_WIDTH,0,-STR_WIDTH,0,0,0,STR_WIDTH,-STR_HEIGHT,

	//  'S'
	STR_WIDTH,STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,0,STR_WIDTH,0,STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,

	//  'T'
	-STR_WIDTH,STR_HEIGHT,STR_WIDTH,STR_HEIGHT,0,STR_HEIGHT,0,-STR_HEIGHT,

	//   'U'
	-STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,STR_WIDTH,STR_HEIGHT,

	//   'V'
	-STR_WIDTH,STR_HEIGHT,0,-STR_HEIGHT,STR_WIDTH,STR_HEIGHT,

	// 'W'
	STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,0,0,-STR_WIDTH,-STR_HEIGHT,-STR_WIDTH,STR_HEIGHT,

	// 'X'
	-STR_WIDTH,STR_HEIGHT,STR_WIDTH,-STR_HEIGHT,STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,

	// 'Y'
	-STR_WIDTH,STR_HEIGHT,0,0,STR_WIDTH,STR_HEIGHT,0,0,0,-STR_HEIGHT,


	// 'Z'
	-STR_WIDTH,STR_HEIGHT,STR_WIDTH,STR_HEIGHT,-STR_WIDTH,-STR_HEIGHT,STR_WIDTH,-STR_HEIGHT
};

void initFonts()
{
	int count = 0;
	for (int i =0; i < 27; i++)
	{
		letterInfo[i][2] = count;
		count += letterInfo[i][1];
	}
}

void drawString (char *output)
{
	GLint length,i;


	length = strlen (output);
	glVertexPointer(2, GL_FLOAT,  0, rawData);

	for(i=0;i<length;i++)
	{
		char aChar = output[i];
		if (aChar ==' ')
		{
			aChar ='[';
		}
		int index = aChar - 'A';

		glDrawArrays(letterInfo[index][0], letterInfo[index][2], letterInfo[index][1]); 

		glTranslatef(STR_SPACE,0,0);
	}

}
Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!