[tankpack] turret camera
by Pat AfterMoon · in Torque Game Engine · 01/19/2005 (3:23 pm) · 49 replies
This thread related to the BraveTree TankPack is intended to continue the discussion started here, but in private forum like Joe Maruschak from BraveTree has suggested.
So, I have commented BraveTree camera code and script, and reintroduced the eye/cam classic view like Michael Cozzolino has described. It works, but I have a little bug, similar to one already existing in Paul Dana Turret resource :
My eye node's parent is the codeWeapon node, so in 1st person view, It look where barrel aim. If I use the eye2 position the bug never occur. If I use the eye1 position the bug occur. I have modified tank datablock for allow horizontal 360 degree turn range and vertical 90 degree, for testing. The bug seem to occur when I look to the left or right (90 degree) or when I move the barrel up, first it work well, when I reach 45 degree the barrel and complete tank disappear, then if I move up a little bit it reappear.
I have enlarged the bound object with 3dsmax in case of, but no changement, any idea ?
So, I have commented BraveTree camera code and script, and reintroduced the eye/cam classic view like Michael Cozzolino has described. It works, but I have a little bug, similar to one already existing in Paul Dana Turret resource :
Quote:in first person view the turret's barrel disappears for certain pitch angles. I am not sure what causes this. The turret still functions...you just can't see the barrel at those angles in first person view.Look at the 3dsmax screenshot :
My eye node's parent is the codeWeapon node, so in 1st person view, It look where barrel aim. If I use the eye2 position the bug never occur. If I use the eye1 position the bug occur. I have modified tank datablock for allow horizontal 360 degree turn range and vertical 90 degree, for testing. The bug seem to occur when I look to the left or right (90 degree) or when I move the barrel up, first it work well, when I reach 45 degree the barrel and complete tank disappear, then if I move up a little bit it reappear.I have enlarged the bound object with 3dsmax in case of, but no changement, any idea ?
#2
So going by your pic I would put it down and back to the beginning of the turret.
01/19/2005 (8:15 pm)
@ Pat I have my Tank's eye so it doesn't do that. I can send you my .dts or I could try to explain where I put the eye node. So going by your pic I would put it down and back to the beginning of the turret.
#3
-roger
01/19/2005 (11:27 pm)
Hi guys, I also own the tank pack. Although i haven't touch anything yet with it, i 'm much interested what have been going around here. I'm just starting to incorporate the lighting pack, so no changes for me yet in stock tank pack. Any updates will be appreciated much. -roger
#4
01/20/2005 (4:40 am)
Another pack owner here, I love the models, but like fail I don't have max or lightwave. Is it possible to get a 3ds so I can import to Truespace?
#5
I don't exactly know how it is determinated if a DTS has to be rendered, but it seem that if you are outside the bounds and if the object is behind you, the DTS isn't rendered (it make sense). So, if you attach your "eye" node to the barrel, you have to be sure that it is always inside the bounds of the tank, for any angles.
01/24/2005 (3:58 pm)
Ok, I've fixed the problem about "tank disappears for certain pitch angles". I have enlarged the tank bounds and now it doesn't occur. My first try of enlarging bounds was false, because I've used the scale tool and forgot to reset transforms with the box trick.I don't exactly know how it is determinated if a DTS has to be rendered, but it seem that if you are outside the bounds and if the object is behind you, the DTS isn't rendered (it make sense). So, if you attach your "eye" node to the barrel, you have to be sure that it is always inside the bounds of the tank, for any angles.
#6
Thanks!
Joe
02/26/2005 (10:07 am)
I'm also a pack owner and would be interested in getting the changes mentioned here, could someone please email the files and any instructions you might have? Thanks!
Joe
#7
03/01/2005 (5:07 am)
I own the Tank Pack as well and have been wanting the turret camera to work. Please notify me if there are any updates. Having problems with exporters for this so it would solve the issue.
#8
Howard, what kind of export problems are you having?
03/01/2005 (5:15 pm)
I am interested in this camera code.Howard, what kind of export problems are you having?
#9
But why don't we ask Bravetree for an update
03/01/2005 (6:30 pm)
Maybe, I think, we should send an email to Bravetree and see if they will implement this. I tried but failed. Don't have access to any 3Dapp that will load it. I tried Blender but got lost in the UI.But why don't we ask Bravetree for an update
#10
A few features I need are...
Ability to traverse the turret 360 degrees, I can get it to do this, but it stops at 360/0 degrees on the 2nd time around. Also, I would like to see rotation speed for the turret.
Secondly, I would like seperate vertical barrel rotation, one for positive angle up and one for negative angle down. Most tanks don't go up and down 20 degrees but something more like up 20 and down 5.
If anyone has any code snippets to help me out, I'd appreciate it.
03/01/2005 (7:29 pm)
Here is something else I am interested in having, I am not the best coder so I am stuck on how to implement, they shouldn't be that hard.A few features I need are...
Ability to traverse the turret 360 degrees, I can get it to do this, but it stops at 360/0 degrees on the 2nd time around. Also, I would like to see rotation speed for the turret.
Secondly, I would like seperate vertical barrel rotation, one for positive angle up and one for negative angle down. Most tanks don't go up and down 20 degrees but something more like up 20 and down 5.
If anyone has any code snippets to help me out, I'd appreciate it.
#11
Robert
03/01/2005 (8:02 pm)
I've seen this happen in some of my models when the camera node leaves the bounding box. Increase the bounding box to encompass the camera node through the extents of all animations.Robert
#12
For the modification that restore the classic vehicle camera management, look at the start of this discussion in previous thread :
www.garagegames.com/mg/forums/result.thread.php?qt=24056
03/02/2005 (1:25 am)
Quote:Ability to traverse the turret 360 degreesI have same problem, my first attempt to change this doesn't work, but the day I will fix it, I will post it.
Quote:I would like seperate vertical barrel rotation, one for positive angle up and one for negative angle down. Most tanks don't go up and down 20 degrees but something more like up 20 and down 5For my tank I have simply changed the turretVerCenter and turretVerRange of the tank datablock. If you don't care too much about turretVerCenter (It's only the starting position) you can have the range you want. In your case for "up 20 and down 5" you can take turretVerRange = 12.5 and turretVerCenter = 7,5.
For the modification that restore the classic vehicle camera management, look at the start of this discussion in previous thread :
www.garagegames.com/mg/forums/result.thread.php?qt=24056
#13
in tankShape.cc line 1692
replace
And in your TankDB.cs set turretHorRange to 360
The tankShape code will no longuer clamp turret horizontal range.
03/04/2005 (8:53 am)
Quote:Ability to traverse the turret 360 degrees
in tankShape.cc line 1692
replace
tHor = mClampF(tHor,-1.0f,1.0f);by
if ( getDataBlock()->turretHorRange < 360.0 )
tHor = mClampF(tHor,-1.0f,1.0f);And in your TankDB.cs set turretHorRange to 360
turretHorRange = 360.0; // range in +/- degrees of turret horizontally
The tankShape code will no longuer clamp turret horizontal range.
#14
03/05/2005 (6:05 am)
Someone should update the turret resource to mention the fix for the disappearing barrel: Namely to expand the bounds to include the space the barrel will take up no matter WHAT angle it is at.
#15
03/05/2005 (10:01 am)
This same thing happens on mounted weapons for players and I think both should be changed in the engine to render no matter the bounds box. If you have to set the bounds box beyond the limit of the tank tub then you can drive off cliffs and not fall.
#16
in tankShape.cc in the function
After the line:
Add:
this replaces the side view with the turret view.
04/12/2005 (11:54 am)
Turret camera in 4 lines of code....in tankShape.cc in the function
void TankShape::getCameraTransform(F32* pos,MatrixF* mat)
After the line:
altMode = pos && *pos>0.5f;
Add:
if( altMode ) {
getMuzzleTransform(mat);
return;
}this replaces the side view with the turret view.
#17
But is there anyway to bring the camera back abit? (so you see the barrel on screen)
04/23/2005 (4:53 pm)
Jack, just what I needed (well one of the things anyway)But is there anyway to bring the camera back abit? (so you see the barrel on screen)
#18
Also, is anyone who is an owner of the tank pack interested in helping work on a World War 2 tank game? Please get in touch with me at matthuston@gmail.com if you are.
04/23/2005 (7:53 pm)
Has anyone attempted to create particles for this, I am looking into creating exhaust, wheel dust particles, and treads. Has anyone implemented any of those?Also, is anyone who is an owner of the tank pack interested in helping work on a World War 2 tank game? Please get in touch with me at matthuston@gmail.com if you are.
Torque Owner Dave D