A colleague of mine shops there. Personally I just stick with Steam. Not always the best price (often competes with Amazon and g2g), but if I’m going to buy something I do it with the mentality of supporting the devs.
If I understand this correctly, I think the problem is understanding what a camera really is. A camera is just a transformation matrix (aka view matrix) that you must calculate the inverse to and apply to all objects in your world. gluLookAt() is a fixed function method that will set the transformation matrix for the current matrix stack. Typically you call this once, then push the stack, then render all your objects by first pushing their individual matrices on the stack, rendering the object, then popping the stack so those object transformations don’t effect future renders.
I don’t know how the Box2D rendering sample works (or if you rolled your own), but I would say stop what your doing immediately. Fixed function programming is deprecated. You should be using programmable shaders (minimum OpenGL 2.x API) and performing your transformations on the GPU. I don’t know of any sites where you can start, but try opengl-tutorial.org. Alternatively, consider an engine suited for 2D gameplay, such as Torque 2D, which I just now found out is open-source.
Working on a new short film called ‘Simple Business’. Starting on some medieval music today! Contact me at benrawles.com if you need a composer or sound designer.
Umm… Okay! My code is a little messy. But, I’ll try to make it understandable to the best of my efforts. Here goes…
This is the camera class,
#define PI 3.14
#define PIdiv180 (PI/180)
GLfloat x, y, z;
GLfloat x, y;
P_3D_Vector View_3D_Vector(GLfloat x, GLfloat y, GLfloat z);
GLfloat Rotated_X, Rotated_Y, Rotated_Z;
void Look(P_3D_Vector Direction);
void Rotate_X(GLfloat Angle); // To rotate the camera along the X-axis
void Rotate_Y(GLfloat Angle); // To rotate the camera along the Y-axis
void Rotate_Z(GLfloat Angle); // To rotate the camera along the Z-axis
void Look_Z(GLfloat Distance); // To translate the camera along the X-axis
void Look_Y(GLfloat Distance); // To translate the camera along the Y-axis
void Look_X(GLfloat Distance); // To translate the camera along the Z-axis
The Include.h is a single header containing all the headers of all the different libraries.
#define SQR(P) (P*P)
#define NULL_VECTOR View_3D_Vector(0.0f, 0.0f, 0.0f)
P_3D_Vector View_3D_Vector(GLfloat x, GLfloat y, GLfloat z)
Temporary.x = x;
Temporary.y = y;
Temporary.z = z;
GLfloat Get_View_3D_Vector_Length(P_3D_Vector *V)
return (GLfloat)(sqrt(SQR(V->x) + SQR(V->y) + SQR(V->z)));
P_3D_Vector Normalize_3D_Vector(P_3D_Vector V)
float l = Get_View_3D_Vector_Length(&V);
if(l == 0.0f)
Resultant.x = V.x / l;
Resultant.y = V.y / l;
Resultant.z = V.z / l;
P_3D_Vector operator+ (P_3D_Vector V, P_3D_Vector U)
Resultant.x = V.x + U.x;
Resultant.y = V.y + U.y;
Resultant.z = V.z + U.z;
P_3D_Vector operator- (P_3D_Vector V, P_3D_Vector U)
Resultant.x = V.x - U.x;
Resultant.y = V.y - U.y;
Resultant.z = V.z - U.z;
P_3D_Vector operator* (P_3D_Vector V, float R)
Resultant.x = V.x * R;
Resultant.y = V.y * R;
Resultant.z = V.z * R;
P_3D_Vector Cross_Product (P_3D_Vector *U, P_3D_Vector *V)
Resultant_Vector.x = U->y * V->z - U->z * V->y;
Resultant_Vector.y = U->z * V->x - U->x * V->z;
Resultant_Vector.z = U->x * V->y - U->y * V->x;
float operator* (P_3D_Vector V, P_3D_Vector U)
return V.x * U.x + V.y * U.y + V.z * U.z;
Position = View_3D_Vector(0.0f, 0.0f, 0.0f); // Initializing the position of camera
View_Direction = View_3D_Vector(0.0f, 0.0f, -1.0f); // Initializing which direction to look at
Right_Vector = View_3D_Vector(1.0f, 0.0f, 0.0); // Initializing the rightward direction vector
Up_Vector = View_3D_Vector(0.0f, 1.0f, 0.0f); // Initializing the upward direction vector
Rotated_X = Rotated_Y = Rotated_Z = 0.0f; // Initial Angle
void Perspective_View::Look(P_3D_Vector Direction) // Translating the camera in all dimensions
Position = Position + Direction; // Incrementing position of camera when translated
void Perspective_View::Rotate_X(GLfloat Angle) // Rotating along the X-axis
Rotated_X += Angle; // Incrementing change in X-axis angle
View_Direction = Normalize_3D_Vector(View_Direction * (GLfloat)cos(Angle * PIdiv180) + Up_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating viewing direction
Up_Vector = Cross_Product(&View_Direction, &Right_Vector) * -1; // Updating upward direction vector
void Perspective_View::Rotate_Y(GLfloat Angle) // Rotating along the Y-axis
Rotated_Y += Angle; // Incrementing change in Y-axis angle
View_Direction = Normalize_3D_Vector(View_Direction * (GLfloat)cos(Angle * PIdiv180) + Right_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating viewing direction
Right_Vector = Cross_Product(&View_Direction, &Up_Vector); // Updating rightward direction vector
void Perspective_View::Rotate_Z(GLfloat Angle) // Rotating along the Z-axis
Rotated_Z += Angle; // Incrementing change in Z-axis angle
Right_Vector = Normalize_3D_Vector(Right_Vector * (GLfloat)cos(Angle * PIdiv180) + Up_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating rightward direction vector
Up_Vector = Cross_Product(&View_Direction, &Right_Vector) * -1; // Updating upward direction vector
void Perspective_View::Render_View(void) // Rendering the camera view
P_3D_Vector View_Point = Position + View_Direction; // Incrementing center with change in movement
gluLookAt(Position.x, Position.y, Position.z, View_Point.x, View_Point.y, View_Point.z, Up_Vector.x, Up_Vector.y, Up_Vector.z); // gluLookAt() used here to see the game space
void Perspective_View::Look_Z(GLfloat Distance) // Translating the camera along Z-axis
Position = (View_Direction * -Distance); // Updating position
void Perspective_View::Look_X(GLfloat Distance) // Translating the camera along Z-axis
Position = (Right_Vector * Distance); // Updating position
void Perspective_View::Look_Y(GLfloat Distance) // Translating the camera along Z-axis
Position = (Up_Vector * Distance); // Updating position
The Main Window,
Perspective_View Current_View; // Declaring an object for the Perspective_View class
b2Vec2 World_Gravity(0.0f, 9.8f); // Defining gravity
b2World *Game_World = new b2World(World_Gravity, true); // Creating the Box2D world
Ground_Body_Def.type = b2_kinematicBody; // Defining type of body
Ground_Body_Def.position.Set(0, 768); // Setting initial position
b2Body *Ground_Body = Game_World->CreateBody(&Ground_Body_Def); // Creating body
Ground_Shape.SetAsBox(2000, 69); // Defining body shape
Ground_Fixture_Def.shape = &Ground_Shape; // Defining body fixtures
Ground_Body->CreateFixture(&Ground_Fixture_Def); // Binding fixture to body
bool No_Key_Pressed = true;
bool Facing_Right = true;
while(/*window is running*/)
Game_World->Step(1/60, 8, 3); // Iterating the game world in Box2D
if(/*Right Key Pressed*/)
No_Key_Pressed = false;
Facing_Right = true;
if(/*Left Key Pressed*/)
No_Key_Pressed = false;
Facing_Right = false;
Current_View.Look_X(0.0); // Don't move
Current_View.Look_X(1.0); // Move Right
Current_View.Look_X(-1.0); // Move Left
No_Key_Pressed = true;
Current_View.Render_View(); // Here, we are calling the render function containing the gluLookAt()
This is the Main Window. It is quite messy. I have omitted the OpenGL drawing and rendering methods. They execute perfectly so I did not include them in the code above. However, the OpenGL camera and Box2D is the problematic part, hence I included only those function calls. Thank you for your patience to go through my code. It is quite long, I know. You need not go through the whole Perspective_View class. I just included it to show what it does. The actual problem is in the MainWindow itself. I hope it is clear and understandable help solve the problem. Please help me on this. Thank you.
Can you post some code (Please remember to format it so we can read it clearly)
Using gluLookAt for 2D is a really bad idea. It’s designed for a perspective view.
Well, I used gluLookAt() to create a 3D projection matrix but I am only using the X and Y co-ordinates to move the camera in only two dimensions. Is this the reason why my camera is unable to affect the Box2D bodies? Will using glOrtho() solve this problem? Please tell me this. Thank you.
Box2D just returns a set of 2D body positions, unless you are using the debug renderer, rendering is completely up to you.
gluLookAt creates a 3D view matrix, are you projecting the bodies into a 3D space?
I think that is unlikely.
Try using glOrtho instead of gluLookAt
Yes, a mate of mine put it together and has set up a company just to put together more bundles like this.
It’s surprisingly hard to get developers to agree to bundles.
I think that’s part of it. Part of it is that game players and critics are always crying for something new. I see so many reviews that say, there’s nothing new here, so developers start throwing in lame things to please them. Games should just be a constant refinement of game play, tactics, and story delivery if it’s a story game. If anything they should take extraneous things out and be making the UI more intuitional but not to a point where it interferes with strategy.
ANNOUNCEMENT: Only 14 days left until BaconGameJam 07 ;) If you haven´t already registered you might do it now.
Do you want to participate in team? No problem. Use our Teamfinder to get yours. There are a lot of people around looking for one
There comes a time when you have to either sack, or move a game designer.
I’ve seen it before. They have a hit game, get an ego, release a follow up game, ego gets bigger.
After a few iterations they believe they can do anything and it will be a hit.
So they start playing with the format, change this, change that, blah blah blah
In the complete and total belief that they are infallible.
As we all know, no one is infallible.
We have gotten some great reviews/let’s plays from some big names on the youtubes: https://www.youtube.com/watch?feature=player_detailpage&v=zSndvoT8Anc#t=5
I give my old games to my brother who just basically plays games all the time and doesn’t have a lot of money. I think I gave him a final fantasy a while back because I didn’t like it. Played it about half an hour. I didn’t like the fights, thought I would. The worst was they added these quick time events where you had to push a certain button in a given amount of time. Totally ruined it. I wonder what they are thinking when they add things like that? Here’s a great idea, you have to push a button in a certain amount of time. No strategy, nothing, just push it while it’s lit up. And we’ll change the buttons you have to push, so it won’t be an automatic thing, it will always be frustrating.
oh i thought my poo was important… its big poo tho! fit on a whole wall, the biggest poo of all time, a big poo is more important, but also more of a disgrace.
We are working on our own login system so you don’t have to use Facebook. Also, we are talking to some pretty cool YouTubers that are gonna be making Let’s Plays with us. They have over 200k combined subscribers so I think that will bring in some traffic :)
Speaking with Joystiq, Kitase said that he “wasn’t really shocked. There are negative reviews and positive reviews, it’s a real mixture. When I started making this game I took on very new challenges, so in a way I had anticipated that there would be mixed opinions, so this is more or less what we had anticipated.”
He anticipated mixed opinions!!!! What a complete and utter cock.
What he is saying is he DELIBERATELY alienated some players. Why the feck would you do that?
This guy is an advert for forced euthanasia
oh. looking graphics for this game. :) like this
I can’t speak on behalf of the latest Final Fantasies since I stopped playing them after 7, but every one I played was a masterpiece. Having said that, I’d play it to the end and enjoy it for its story. I never really bothered with grinding or finding the top tier treasure in those games. For me, it was all about the story and I even remember a great deal of the plots and characters from all of the series I played. That’s hard to say for a lot of other top games I’ve played where I can only recall certain images and nothing about the characters or their plots.
Sell it used online? Won’t get full price for it, but better than nothing.
Continue-play wrote an article about us. http://www.continue-play.com/news/town-of-salem-seeks-funding-on-kickstarter/
We are at 31% funded! The $50 early bird specials sold out very quickly so we added 25 more of them. With a $50 donation you will unlock all of the cosmetic effects for life, you won’t need to pay for anything in the game ever. The game is free to play but the shop sells things like new houses, character skins, pets and other cosmetic effects.
wow 5 whole dollars! shit man im excited!!!!
We are doing a testing event tomorrow at 4pm CST. The Devs will also be in our teamspeak server to personally answer questions for people and to talk with the community.
Maybe your driver or hardware is blacklisted by the browser and it goes back to software rendering. Updating your driver usually helps.
They would definitely do better if Kinect was optional. People need to remember the design changed since the original Xbox One inception. The “online-only” fiasco really put a niche in the game. Honestly, I think developers are just being lazy when it comes to unlocking the true potential of the console, citing Sony as “easier”. The Xbox One has a great deal of life, the Playstation 4 is the current lovechild of the industry. Sony made a great console, but it hasn’t floored me. Supposedly, it has more horsepower, but it’s not always the size of the tool that counts. It’s how that tool is used.