The third person Crosshair
by Ari J · in Torque Game Engine · 11/08/2004 (8:35 am) · 18 replies
Hello, i've searched the forums pretty thoroughly and the only third person crosshairs i can find is code that not only renders the crosshair in third person but also makes it shake like hell, and it seems to get bigger.
Is there anyone wich can point out for me how to simply render the crosshair in third person?
(and it would also be handy to know how to move the posisiton of the default camera, so that the player model would bee a litle south-west of the crosshair, like in max payne.)
Ari J.
Is there anyone wich can point out for me how to simply render the crosshair in third person?
(and it would also be handy to know how to move the posisiton of the default camera, so that the player model would bee a litle south-west of the crosshair, like in max payne.)
Ari J.
About the author
#2
11/08/2004 (12:06 pm)
The fix for shaking works. But it's still oversized.
#3
11/08/2004 (12:47 pm)
I'm pretty sure theres something in the tge thats really easy to change to draw the crosshair in thirdperson. I did it ages ago but I cant remember where it was, I'll have a search.
#4
11/09/2004 (12:31 am)
If you can find out what it was, it would be really helpful. All i'm looking for is simply a line to render it in third person.
#5
The one line change Craig referrs to is there is a check when renderring the crosshair to stop rendering if you're in 3rd person. The hack is to remove that. That will get you a 3rd person crosshair that sits in the middle of the screen, which wont be at all accurate when you move the camera.
T.
11/09/2004 (1:46 am)
For 3rd person crosshair to work on screen you need to set the GuiCrossHairHud to take up the entire screen (make sure its at the back of the zorder too) and ensure the extent is set correctly when you render.The one line change Craig referrs to is there is a check when renderring the crosshair to stop rendering if you're in 3rd person. The hack is to remove that. That will get you a 3rd person crosshair that sits in the middle of the screen, which wont be at all accurate when you move the camera.
T.
#6
11/09/2004 (1:49 am)
3rd person crosshairs are obviously not wery easy to make, are they? o_0
#7
Because you do not look down the barrel of the gun - so what do you shoot at? The point where your cam -> reticle hits the terrain/object/water? Or should your character just shoot in the direction of the cam->reticle like in 2d?
Its not trivial and depends totally on your game.
One solution is to draw a 3d object inside the scene as your reticle instead of a 2d one. It has some advantages and some disadvantages. But its one way to do it
11/09/2004 (11:03 am)
They are not AriBecause you do not look down the barrel of the gun - so what do you shoot at? The point where your cam -> reticle hits the terrain/object/water? Or should your character just shoot in the direction of the cam->reticle like in 2d?
Its not trivial and depends totally on your game.
One solution is to draw a 3d object inside the scene as your reticle instead of a 2d one. It has some advantages and some disadvantages. But its one way to do it
#8
11/15/2004 (3:11 am)
Hm, I just figured that i could generate the projectile the same way as in first person, like in Ut2k4 3rd person, so that the crosshair is showed through the player, i think i can work my way from there.
#9
11/18/2004 (8:52 am)
Could anyone tell me how to do that wich is described above?
#10
What I want the most is a Hitman2 style 3rd person crosshair, which acts just like the first person crosshair. The crosshair always stays at the center of the screen, and the player shoots at the position where the crosshair is. I find this more easy to work with then a crosshair that jitters or jumps (I think UT2k3 did this, but can't remember now).
11/29/2004 (5:10 am)
For our crosshair, I did something similiar to Thomas suggestion I think. I used a raycast to find where the player was looking, then used the project/unproject() call to turn that position into 2d screen coords, then I place the crosshair there. So with this technique, the crosshair points at where the player is looking, but is not always positioned at the vertical center of the screen, sometimes it moves up and down.What I want the most is a Hitman2 style 3rd person crosshair, which acts just like the first person crosshair. The crosshair always stays at the center of the screen, and the player shoots at the position where the crosshair is. I find this more easy to work with then a crosshair that jitters or jumps (I think UT2k3 did this, but can't remember now).
#11
11/29/2004 (7:03 am)
Yes, that is excactly what i wan't.
#12
What I did was to reverse that. Take the reticle and the "camera eye" and projecting it into the world, then setting the players aim position to that.
Result = no jumping reticle
You will need to play around with camera/player movement though, as you do not want rotational controls to interact directly with the player, but with the camera. You just need to play with it and make it work for you in your game type.
11/29/2004 (11:34 pm)
Taking the coordinates of where the player looks and projecting that to the screen results in a very jumpy reticleWhat I did was to reverse that. Take the reticle and the "camera eye" and projecting it into the world, then setting the players aim position to that.
Result = no jumping reticle
You will need to play around with camera/player movement though, as you do not want rotational controls to interact directly with the player, but with the camera. You just need to play with it and make it work for you in your game type.
#13
11/30/2004 (6:35 am)
Hmm, can you post this as a recourse? or tell me how you did this?
#14
And no, cannot post it as a resource, as my code does much more than this and I dont want to rip out that part for a resource. It should be fairly easy to figure out from my description.
11/30/2004 (8:48 am)
I just told you :-)And no, cannot post it as a resource, as my code does much more than this and I dont want to rip out that part for a resource. It should be fairly easy to figure out from my description.
#15
Will send you a free copy IF our game ever comes out :)
11/30/2004 (8:56 am)
Well, thank you wery much, you've been a great help :)Will send you a free copy IF our game ever comes out :)
#16
hehehehe
Sorry that I cannot help you more - my 3rd person reticle is mouse controlled in the world and not fixed like you want it. Its also not part of the hud, but an object ingame - check out my "client side object" resource if you want to do something similar. Also click 'n' pick resource will guide you to your target.
But in the end its simply "reverse" the way the other reticles do it. Go from the eye/reticle->terrain coordindates->setAimLocation instead of aim->terrain coordinates->eye/reticle
11/30/2004 (11:12 am)
I'll happily take patent on "my" method - you may pay me with a free game :-)hehehehe
Sorry that I cannot help you more - my 3rd person reticle is mouse controlled in the world and not fixed like you want it. Its also not part of the hud, but an object ingame - check out my "client side object" resource if you want to do something similar. Also click 'n' pick resource will guide you to your target.
But in the end its simply "reverse" the way the other reticles do it. Go from the eye/reticle->terrain coordindates->setAimLocation instead of aim->terrain coordinates->eye/reticle
#17
12/01/2004 (6:24 am)
Thanks, you've been a big help :)
#18
12/04/2004 (3:59 am)
Well, i went the easy way and created a gui bitmap control, works really well acctually :)
Torque 3D Owner Tom Bampton