How should I do it?
Type: Posts; User: evildotaing
How should I do it?
WE all know that when we want user input in openGL, we can key in such as 'w', 'a', 's', 'd', but how about if we want user to keep input like up-arrow, down-arrow, left-arrow, right-arrow in our...
help
This is the code that make the enemy placed randomly instead of moving randomly.
glPushMatrix();
glTranslatef(rand() % 750 , rand() % 550, 0);
drawEnemy();
...
#include <windows.h>
#include <iostream>
#include "gl/freeglut.h"
#include "myenigne.h"
#include "time.h"
#include "stdlib.h"
#include "math.h"
//#pragma comment( linker,...
Your code for the background moved for right to left, how should I move from left to right. And how should I put a stopped for the image when it reach a certain limit so the background map would...
How should I set the value for someYOffset?
I want to make the background to scroll from left to right, right now my background image is in the openGL file, but how should I make it to move. My code for the background image.
/*...
I got this error doing making renderScene static. 1>h:\game protype project\game_v4\dm2231_lab_v4\dm2231_lab\myapplication.cpp(238) : error C2724: 'myApplication::renderScene' : 'static' should not...
I make the function to static void(renderScene); but still not working.
How to do it. Help? Example of some code, I am very confused.
I code what you are saying but now I got new error again. error C2664: 'glutDisplayFunc' : cannot convert parameter 1 from 'void (__thiscall myApplication::* )(void)' to 'void (__cdecl *)(void)'...
I know that if I wan to use print something in openGL, I would used this
glutDisplayFunc(renderScene);
But now the problem is in my code, if I wan to display something in the screen, I use...
So, is there any difference between the 2 functions. I want to use the time to count the amount of seconds for projectile to be launch from a gun.
Help!!!!!!!!!!!!!!
i want to have real timing in openGL such as when I file a projectiles, it would shoot for 3 seconds before disappeared. I serach the web but unsure how to do it. Which function should I used to get...
So, if my code for if (((Position.z <= 0 && Position.z >= -380) && (Position.y >= 0 && Position.y <= 20)) && (Position.x <= 195 && Position.x >= -195)) is wrong? A bit weird that Position.z and...
The skybox is a piece of walls and I am inside a house. So I am using boundary checking for preventing camera to move outside of the skybox. Just that I got problem and the camera can still moved out...
How to code like that using the look vector?
I want to launch a projectile in openGL where when I click my left mouse button, it would shoot a sphere to the position where I am facing. BUt I already confused about the distance to launch. I use...
My codes have no problem staying in skybox except the x-value. I have already check the values, it is definitely right. What is the correct way to use && when I had to make sure the 6 positions is...
All of the codes have no problem expect the last part where I still can move out of the skybox by pressing button ''a' or 'd'. Is my && wrong. I not really good in comparing 6 position using &&.
I am doing a boundary checking in skybox where the camera cannot move out of skybox. But using this code:
if (((Position.z <= 0 && Position.z >= -380) && (Position.y >= 0 && Position.y <= 20))...
Camera.h
#include "gl/freeglut.h"
#include "Vector3D.h"
#pragma once
class Camera {
public:
enum CAM_TYPE { LAND_CAM, AIR_CAM };
1. Download and install microsoft visual C++ studio 2008 express edition. It is free
2. Open visual studio c++ 2008
3. Go to File ->New Project ->
4. In project types, set it to win32, set win32...