Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Lerping viewentity with camera.pan #394136
02/10/12 13:59
02/10/12 13:59
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Hey guys grin
Its me again...
Im trying to lerp a viewentity with camera.pan for realistic weaponaiming code. The viewentity is just created at runtime and will not set to camera position.

Code:
vec_lerp(w1.pan, nullvector, vector(camera.pan/360, camera.tilt/180, 0), 0.4);
vec_lerp(w2.pan, nullvector, vector(camera.pan/360, camera.tilt/180, 0), 0.4);



I tried this but it just change the postion when moving but when I stop moving, it doesnt go back to middle of screen. It just stays there frown
Pleas ehelp me.

Re: Lerping viewentity with camera.pan [Re: Ch40zzC0d3r] #394138
02/10/12 14:43
02/10/12 14:43
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I do not understand what exactly you want to achieve. Could you please explain in more detail or do a quick picture?

Apart from that: lerping with the nullvector is pointless. The code above will set the entities pan angle to a value between 0 and 0.4 and it's tilt angle to a value between -0.2 and 0.2. The changes are so small you will hardly notice them.


Always learn from history, to be sure you make the same mistakes again...
Re: Lerping viewentity with camera.pan [Re: Uhrwerk] #394143
02/10/12 15:20
02/10/12 15:20
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Thank you.
I just got it working now, but NOT with viewentities!
I made a working camera to change weapon x,y,z but weapon is still in midle when turning charachter(changing pan, tilt, roll).

Last edited by Ch40zzC0d3r; 02/10/12 15:21.

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