Saturday, June 30, 2012

Gmod Third Person View Using Wire And E2 - v2

I made a new version of the third person view, which let you move the camera up and down on the pitch rotation.



And here's the E2 "third_person_v2" code:
@name third Person v2
@inputs
@outputs Angle:angle Position:vector
@persist
@trigger

runOnTick(1)

R = 120

Angle = owner():eyeAngles()
Pitch = Angle:pitch()
Yaw = Angle:yaw()

X = cos(Yaw) * R * (-1)
Y = sin(Yaw) * R * (-1)
Z = sin(Pitch) * R + 90

Zx = R - (cos(Pitch) * R)
Xz = cos(Yaw) * Zx
Yz = sin(Yaw) * Zx

if(Z < 0){Z = 0}
Position = owner():pos() + vec(X+Xz,Y+Yz,Z)

2 comments:

  1. You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. Gta 5 download

    ReplyDelete
  2. Want more addon's Garrys mod download where can you get free addon of Gmod and many other stuff. Try this out Man

    ReplyDelete