skyrim head roll

Official forum for open source FreePIE discussion and development.
Post Reply
TheChanger
One Eyed Hopeful
Posts: 4
Joined: Mon Mar 16, 2015 2:40 pm

skyrim head roll

Post by TheChanger »

Hi
I am having a problem getting the head roll functionality to work in skyrim... i was looking for hours to find a working script but nothing helps..

I am using:
Android Device
FreePIE ver. 1.8.569.0
Vireio Perception ver. 2.1.4

this is the script i am using:

[spoiler]

Code: Select all

def update():
   global yaw
   global pitch
   
   yaw = android[0].googleYaw
   pitch = -android[0].googleRoll
   
   vireioSMT.roll = -gaussRoll
   
   diagnostics.watch(yaw)
   diagnostics.watch(pitch)
   diagnostics.watch(vireioSMT.roll)
   
def getRaw(z): #n is the denominator for the value
	rollRaw.append(math.degrees(-(android[index].googlePitch)) / z)
   
if starting:
   yawMult = 1300
   pitchMult = 1000
   rollMult = 5
   gaussMax = 31 #size of filter to gain stability, must be odd number
   index = 0 #which android device to use
   
   centerYaw = 0
   centerPitch = 0
   centerRoll = 0
   
   yaw = 0
   pitch = 0
   roll = 0
   
   rollRaw = list()
   
   #calculate gauss matrix
   gaussMatrix = list()
   for x in xrange(gaussMax):
   		gaussMatrix.append(2.7182818284 ** (-(x-math.floor(gaussMax/2)) ** 2))
   		#example if gaussMax = 3, floor(3/2) = floor(1.5) = 1. x-1
   		#example if gaussMax = 5, floor(5/2) = floor(2.5) = 2. x-2
   print gaussMatrix
   
   #get raw data first
   for x in xrange(gaussMax):
    getRaw(rollMult) #call function raw values with divider as parameter 
   
   prevGauss = [0,0,0] #gauss values tracker, [yaw, pitch, roll]
   
   android[index].update += update
   enabled = True
   
   
#reset gauss values
gaussRoll = 0

#create new gauss values from the collected raw values
#will be updated into vireioSMT in update()
for x in xrange(gaussMax):
	gaussRoll += rollRaw[x] * gaussMatrix[x]

#mouse move code starts here
deltaYaw = filters.delta(yaw)
deltaPitch = filters.delta(pitch)

if (enabled):
	mouse.deltaX = deltaYaw*1300
	mouse.deltaY = deltaPitch*1000
#mouse move code ends here
	
#remove first values of raw lists
#list.remove takes out the first incident of the value in (x) 
rollRaw.remove(rollRaw[0])

#take new value at end of raw lists
getRaw(rollMult)
[/spoiler]

it contols the cursor to look around and it should give imput to vireio to roll the display.
The problem is: when trying to roll, the screen does not realy rotate... it just runs around is small circles.
showing the effect is easier then explaining, so i uploaded a video... it shows what happens, when i try to roll
the screen starts moving around in circles, but no rolling...

what am i doing wrong?
the watch window in FreePIE shows that the vireioSMT.roll value is increasing and decreasing normaly
You do not have the required permissions to view the files attached to this post.
TheChanger
One Eyed Hopeful
Posts: 4
Joined: Mon Mar 16, 2015 2:40 pm

Re: skyrim head roll

Post by TheChanger »

i just found out, that VP 2.1.4 has a nice new option to switch between different head roll options.
matrix conversion did the trick for me

fixed that one
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: skyrim head roll

Post by CyberVillain »

Nice catch!
SimonPDX
One Eyed Hopeful
Posts: 3
Joined: Wed Apr 22, 2015 4:13 am

Re: skyrim head roll

Post by SimonPDX »

This is awesome! Good work dude. I heard that Skyrim head-roll worked but I never looked into it, it's much better with it than without that's for sure.

To get this to work I have to set Roll to Matrix like you did, and then the multiply to -0.05 from 1. Is this normal?

I have been using TrinusVR for headtracking before now and I notice with this script it's not accurate when I try to turn 180 degrees. Sometimes even when facing nearly forward I get some jumps as well, although there is nearly no drift compared to what I expect. Thoughts?

Unfortunately I barely know what the code means and I apologize in advance for that, thanks for sharing though.
Post Reply

Return to “FreePIE”