Hi, people.
I need to create a game that is similar to Resident Evil 1, 2, 3 style. Currently, I've used the Collision tutorial to load a quake 3 map and some quake 2 models.
Currently I need to do some tasks steps by steps and I need some help in doing some of these things.
1) I need to lock the camera so that it will not move; so that I can create something that is similar to Resident Evil.
2) I need to load a model (main character) into the map and uses the keyboard to move her. Left and right will rotate the character while up and down lets the character moves front and back (based on the direction the model faces).
3) Apply collision detection to the model.
Currently, I decided in order to make the whole game. I think I'll start with these three steps. Some help would be great because I just learn OpenGL and C++ for about 6 weeks only. Thanks in advance.
need help in creating a game that is similar to ResidentEvil
1) use addCameraSceneNode like in example 1 rather than addCameraSceneNodeFPS
2) use node->setRotation to rotate, and node->setPosition to move. to know which direction is forwards, use the node's transform to rotate a vector:
backwards is simply "forwards*-1.0f"
3) see the collision example. if you're using pre-rendered backdrops, it's worth noting that your mesh doesn't need to be visible to be collidable.
2) use node->setRotation to rotate, and node->setPosition to move. to know which direction is forwards, use the node's transform to rotate a vector:
Code: Select all
vector3df forwards(0,0,1); // or whatever is forwards for your node
node.getRelativeTransformation().rotateVect(forwards);
node->setPosition( node->getPosition() + forwards*speed*time); // speed and time are floats
3) see the collision example. if you're using pre-rendered backdrops, it's worth noting that your mesh doesn't need to be visible to be collidable.
Thanks, I managed to "lock" the camera and the output is like this, http://www.hostpic.biz/uploads/61daaeea1c.jpg
I've a couple of new questions.
It looks slanted, how do I fix it?
Another thing is the direction the camera is facing. Currently it's what I wanted but what if I want the camera to face another direction but at the same spot?
I've a couple of new questions.
It looks slanted, how do I fix it?
Another thing is the direction the camera is facing. Currently it's what I wanted but what if I want the camera to face another direction but at the same spot?
~ Dream
You might use something like:what if I want the camera to face another direction but at the same spot?
Code: Select all
camera->setTarget(player.getAbsolutePosition());
camera->setPosition(vector3df(X,Y,Z));