Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Weapon aiming #307101
01/27/10 08:26
01/27/10 08:26
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
I need weapon aiming , just like in Call of Duty series or Far Cry 2... I already created weapon aiming with view entity (can upload script)... but i need to create it with world entity... Becouse I will use shaders on weapons... I know how to attach world entity to camera. But I do not know how to change world entity positions smoothly... When I press right mouse key, then weapon should smoothly change it position, and from the right side of screen, must go just in to the center of the screen... So player will be able to aim just like in Call of Duty series...


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Weapon aiming [Re: 3run] #307123
01/27/10 11:46
01/27/10 11:46
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Well, I assume u use a vector for the base offset:

VECTOR weaponOffset;


Then, in the function that positionates the weapons:

if(mouse_right)
{
vec_lerp(weaponOffset,weaponOffset,vector(5,0,-3),0.3);
}
else
{
vec_lerp(weaponOffset,weaponOffset,vector(15,-5,-5),0.3);
}

vec_set(my.x,weaponOffset);
vec_rotate(my.x,camera.pan);
vec_add(my.x,camera.x);
vec_set(my.pan,camera.pan);


Play with the values in the vec_lerp function to achieve what u want. U can also use multi vectors to achieve different offsets for different weapons.

Re: Weapon aiming [Re: the_clown] #313688
03/02/10 21:36
03/02/10 21:36
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Will try laugh thank you


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1