3rd Person [1st Post]
3rd Person [1st Post]
Hello Irrlicht Community!!
My name is Joseph and this is my first post. I am going to explain what I am hoping to achieve fully so I don't make my first ever post look n00bish. Right, I am very interested in Irrlicht and am learning it quite well! I have been using a program called Game Maker since 2005 and thought I would start learning C++!
Right, on the Game Maker Forums people usually make you examples rather than post code snippets so I don't know if what I'm going to ask is unusual to this community. I am wanting to know if anyone on here would be good enough to create me a very simple third person camera, all I am asking is for a Dev Project file with just the simple sydney model, no movement or anything..just the camera placed behind sydney and in third person perspective.
I am hoping what I am asking is not wrong! If people on here don't create example files then I would be happy with code snippets but with some information on how to use them as I am still a beginner. I believe everyone has to start somewhere and everyone has the right to learn. I have chosen to learn how to use Irrlicht.
Is anyone prepared to do this for me? I would be forever in your debt.
Joseph
My name is Joseph and this is my first post. I am going to explain what I am hoping to achieve fully so I don't make my first ever post look n00bish. Right, I am very interested in Irrlicht and am learning it quite well! I have been using a program called Game Maker since 2005 and thought I would start learning C++!
Right, on the Game Maker Forums people usually make you examples rather than post code snippets so I don't know if what I'm going to ask is unusual to this community. I am wanting to know if anyone on here would be good enough to create me a very simple third person camera, all I am asking is for a Dev Project file with just the simple sydney model, no movement or anything..just the camera placed behind sydney and in third person perspective.
I am hoping what I am asking is not wrong! If people on here don't create example files then I would be happy with code snippets but with some information on how to use them as I am still a beginner. I believe everyone has to start somewhere and everyone has the right to learn. I have chosen to learn how to use Irrlicht.
Is anyone prepared to do this for me? I would be forever in your debt.
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
Thank you, I don't just come to forums to learn and be riddled with n00bs, I like to come and make friends. I like to work as an individual but also know there is the community I can rely on. I am told I am a good friend. Just who I amMasterGod wrote:You sound like a really nice person although I cant help you.
But Good Luck learning Irrlicht - I'm doing so too..
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
Will I need to position the camera? And if yes what would i need to do?Dances wrote:This is much simpler than you think. Just make the a camera (not an FPS one) and make it a child of your sydney node and it will follow her wherever she goes.
You can also find camera coding in the snippets area of the forum. There are various 3rd person cameras there.
Cheers
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
Ehm... but wouldn't this ignore Sydney's rotation and always face Sydney from the same direction?
I.E.:
Sydney is facing north; Camera is facing north.
Sydney turns south; Camera still facing south, same position relative to Sydney; Sydney now faces camera.
If you do a search, there IS 3rd person camera nodes.
I.E.:
Sydney is facing north; Camera is facing north.
Sydney turns south; Camera still facing south, same position relative to Sydney; Sydney now faces camera.
If you do a search, there IS 3rd person camera nodes.
Yea I'll specify that when you rotate sydney, the camera rotates with her This is proofing to be more difficult then I thought!linkoraclehero wrote:Ehm... but wouldn't this ignore Sydney's rotation and always face Sydney from the same direction?
I.E.:
Sydney is facing north; Camera is facing north.
Sydney turns south; Camera still facing south, same position relative to Sydney; Sydney now faces camera.
If you do a search, there IS 3rd person camera nodes.
I did do a search before I came hree and read every page, unfortunately they either; don't work, or the links are dead :
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
when sydney is moving...
sydney's
new x coordinate - old x coordinate = a
new y coordinate - old y coordinate = b
camera's
x coordinate = x coordinate + a
y coordinate = y coordinate + b
maybe this should work?...
sydney's
new x coordinate - old x coordinate = a
new y coordinate - old y coordinate = b
camera's
x coordinate = x coordinate + a
y coordinate = y coordinate + b
maybe this should work?...
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
That sounds like a probable solution. Would anyone be willing in making me an example? I work better by example, I am a visual learnerVirion wrote:when sydney is moving...
sydney's
new x coordinate - old x coordinate = a
new y coordinate - old y coordinate = b
camera's
x coordinate = x coordinate + a
y coordinate = y coordinate + b
maybe this should work?...
If not I would like more help, kinda like a step by step
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
Here's a nice way to do a 3rd person camera-
add a dummy transformation node as a child of the node you wish to follow, this is the camera's "where I would like to be" position.
each frame, get the camera's old position ("where i last was") and make a new position based on the direction to the dummy node and speed of your camera ("where i would like to be next frame")
now draw a line from the mesh you are looking at, to the "where i would like to be next frame" position, and collide this with the world's triangle selector. then set this as your camera position.
the result will be a camera that will follow behind your mesh in a nice smooth fashion rather than being glued behind it. you can change the angle and desired distance by moving the dummy node around, but the camera will never get stuck behind a wall - it will move closer to your target if there's not much space.
you could also use another dummy node and do a cam->setTarget on it's absolute position each frame, so the centre of the screen is always where the player is shooting or whatever location is of interest
add a dummy transformation node as a child of the node you wish to follow, this is the camera's "where I would like to be" position.
each frame, get the camera's old position ("where i last was") and make a new position based on the direction to the dummy node and speed of your camera ("where i would like to be next frame")
now draw a line from the mesh you are looking at, to the "where i would like to be next frame" position, and collide this with the world's triangle selector. then set this as your camera position.
the result will be a camera that will follow behind your mesh in a nice smooth fashion rather than being glued behind it. you can change the angle and desired distance by moving the dummy node around, but the camera will never get stuck behind a wall - it will move closer to your target if there's not much space.
you could also use another dummy node and do a cam->setTarget on it's absolute position each frame, so the centre of the screen is always where the player is shooting or whatever location is of interest
Wow that sounds difficult!bitplane wrote:Here's a nice way to do a 3rd person camera-
add a dummy transformation node as a child of the node you wish to follow, this is the camera's "where I would like to be" position.
each frame, get the camera's old position ("where i last was") and make a new position based on the direction to the dummy node and speed of your camera ("where i would like to be next frame")
now draw a line from the mesh you are looking at, to the "where i would like to be next frame" position, and collide this with the world's triangle selector. then set this as your camera position.
the result will be a camera that will follow behind your mesh in a nice smooth fashion rather than being glued behind it. you can change the angle and desired distance by moving the dummy node around, but the camera will never get stuck behind a wall - it will move closer to your target if there's not much space.
you could also use another dummy node and do a cam->setTarget on it's absolute position each frame, so the centre of the screen is always where the player is shooting or whatever location is of interest
Could you possibly make me an example of that? That would be simply amazing, if I had PayPal I would pay someone for the example but I am only 15 and not very wealthy to be honest.
I'm just in need of help so I can continue learning
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
Maybe before trying something like that try again understand 100% the tutorials and make a lot of simple programs with what you have learned from the examples, then when you will be more experienced it will be less difficult to understand what he said and actually do it Yourself!
Well, this is what I do..
Well, this is what I do..
ThanksMasterGod wrote:Maybe before trying something like that try again understand 100% the tutorials and make a lot of simple programs with what you have learned from the examples, then when you will be more experienced it will be less difficult to understand what he said and actually do it Yourself!
Well, this is what I do..
I think that is the best idea, I'll read through the tutorials again I'm starting to get things now, I can do the hello world and quake map myself, almost the movement all by myself too
Getting there lol
Joseph
#include <iostream>
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
using namespace std;
int main()
{
....printf ("HELLO WORLD!\n");
....system ("pause");
}
Code: Select all
LineFromTargetToOptimal.start = TargetLocation;
LineFromTargetToOptimal.end = OptimalPosition->getPosition();
vector3df Intersection;
triangle3df CollidedTriangle;
if (Camsmgr->getSceneCollisionManager()->getCollisionPoint( LineFromTargetToOptimal, CollisionSelector, Intersection, CollidedTriangle))
{
GoingToPosition->setPosition(Intersection);
} else
{
GoingToPosition->setPosition(OptimalPosition->getPosition());
}
Code: Select all
ITriangleSelector* CollisionSelector;
vector3df TargetLocation;
line3d<f32> LineFromTargetToOptimal;
ISceneNode* OptimalPosition,* GoingToPosition;
IrrlichtDevice* CamDevice;
ISceneManager* Camsmgr;
the getCollisionPoint( LineFromTargetToOptimal, CollisionSelector, Intersection, CollidedTriangle) is the part that keep making the application crash either on read or later, depending of the Irr lib I use.
And yes this is based on Bitplane's technique and if it works well I'll post the whole thing ^^
Anyone seeing my mistake'd be very kind to point me to it, thank you very much ^^