Quake3World.com Forums
     Programming Discussion
        scope is the wrong size in 3rd person


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: scope is the wrong size in 3rd person

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 11-03-2005 03:32 AM           Profile Send private message  E-mail  Edit post Reply with quote


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?



_________________
Smokin' Guns
Monster Browser


Top
                 

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 11-03-2005 05:10 AM           Profile Send private message  E-mail  Edit post Reply with quote


I figured out how to scale the scope down. Now I just need to position it straight, it's a bit to the side of the gun. But I guess I'll figure it out if I try for a while. :)



_________________
Smokin' Guns
Monster Browser


Top
                 

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 11-05-2005 04:56 AM           Profile Send private message  E-mail  Edit post Reply with quote


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 );



_________________
Smokin' Guns
Monster Browser


Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.