I'm working on a mod where one rifle has got a scope you can attach to it. And it looks fine in first person. The problem is that it's not drawn in 3rd person. When I try to add it in third person in CG_AddPlayerWeapon, it doesn't get scaled correctly. It shows up in the correct position and all, but it isn't scaled down to match the gun. Maybe it's still drawn in the 1st person weapon model scale.
Would I need to add a different model for the scope in 3rd person, or can I scale it down somehow?
scope is the wrong size in 3rd person
scope is the wrong size in 3rd person
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
How can I change the angle of the scope? I got it positioned correctly, but it points in a slightly wrong direction. Maybe because the tag_scope on the gun model is adjusted to work in the first person view, because that looks just right. If I put the back end of the scope centered on the barrel of the gun, the front end is a little bit off to the side of the barrel. There seems to be no code to change the orientation of the gun model, otherwise I could just do the same thing for the scope.
The scope code in CG_AddPlayerWeapon is this:
// add scope (3rd person view)
memset( &scope, 0, sizeof( scope ) );
VectorCopy( gun.lightingOrigin, scope.lightingOrigin );
scope.shadowPlane = gun.shadowPlane;
scope.renderfx = gun.renderfx;
scope.hModel = cgs.media.model_scope;
CG_PositionEntityOnTag( &scope, &gun, gun.hModel, "tag_scope");
VectorScale(scope.axis[0], 0.50, scope.axis[0]);
VectorScale(scope.axis[1], 0.50, scope.axis[1]);
VectorScale(scope.axis[2], 0.50, scope.axis[2]);
// center over gun
AngleVectors(cg.refdefViewAngles, forward, right, up);
VectorMA(scope.origin, -2, right, scope.origin);
trap_R_AddRefEntityToScene( &scope );
The scope code in CG_AddPlayerWeapon is this:
// add scope (3rd person view)
memset( &scope, 0, sizeof( scope ) );
VectorCopy( gun.lightingOrigin, scope.lightingOrigin );
scope.shadowPlane = gun.shadowPlane;
scope.renderfx = gun.renderfx;
scope.hModel = cgs.media.model_scope;
CG_PositionEntityOnTag( &scope, &gun, gun.hModel, "tag_scope");
VectorScale(scope.axis[0], 0.50, scope.axis[0]);
VectorScale(scope.axis[1], 0.50, scope.axis[1]);
VectorScale(scope.axis[2], 0.50, scope.axis[2]);
// center over gun
AngleVectors(cg.refdefViewAngles, forward, right, up);
VectorMA(scope.origin, -2, right, scope.origin);
trap_R_AddRefEntityToScene( &scope );
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]