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)

Thursday, June 21, 2012

Gmod Third Person View Using Wire And E2

I decided to share a third person view thing I made in Garry's Mod using Wiremod, and E2.



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

runOnTick(1)

R = 120

Angle = owner():eyeAngles()
Yaw = Angle:yaw()
X = cos(Yaw) * R * (-1)
Y = sin(Yaw) * R * (-1)

Position = owner():pos() + vec(X,Y,90)

Sunday, June 10, 2012

A* Pathfinding Demonstration

I decided to try implementing the A* pathfinding algorithm for the practice.
I followed this tutorial, using C++ as my language, and SFML for the graphics.

You can download and try playing around with the program from here:
MediaFire (Adfly)



Here's a video of the demonstration: