Skip to content

Commit 9b3d413

Browse files
committed
Copied over missing files.
1 parent 27f1984 commit 9b3d413

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

animation/bootstrap.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import sys
3+
4+
# Setup the path to known locations of GLFW's DLL on Windows
5+
if sys.platform == 'win32':
6+
import platform
7+
bits = platform.architecture()[0][:2]
8+
os.environ['PATH'] += os.pathsep + r'C:\ProgramData\chocolatey\msvc120-{}\bin'.format(bits)
9+
10+
# Inject support for local font loading into VisPy.
11+
def _get_vispy_font_filename(face, bold, italic):
12+
return os.path.join(os.path.dirname(__file__), 'data/questrial.ttf')
13+
14+
# Fonts on Mac OSX.
15+
if sys.platform == 'darwin':
16+
from vispy.util.fonts import _quartz
17+
_quartz._vispy_fonts = ('Questrial',)
18+
_quartz._get_vispy_font_filename = _get_vispy_font_filename
19+
del _quartz
20+
21+
# Fonts on Windows and Linux.
22+
if sys.platform in ['win32', 'linux']:
23+
from vispy.util.fonts import _freetype
24+
_freetype._vispy_fonts = ('Questrial',)
25+
_freetype._get_vispy_font_filename = _get_vispy_font_filename
26+
del _freetype

animation/display.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22
import sys
33
import bootstrap # Demonstration specific setup.
4-
# import scipy.misc # Image loading and manipulation.
5-
import vispy.scene # Canvas & visuals for rendering.
4+
import vispy.scene # Canvas & visuals for rendering.
65
import numpy
76

87
import collections
@@ -24,7 +23,7 @@
2423
class Application(object):
2524

2625

27-
def __init__(self, example_idx, title='nucl.ai16'): #, range=(0,850)):
26+
def __init__(self, example_idx, title='nucl.ai Motion Matching'): #, range=(0,850)):
2827
self.canvas = vispy.scene.SceneCanvas(
2928
title=title,
3029
size=(1280, 720),
@@ -64,7 +63,7 @@ def __init__(self, example_idx, title='nucl.ai16'): #, range=(0,850)):
6463

6564
self.timer_toggle = True
6665
self.player_position = numpy.asarray([0,0])
67-
self.paths_data = paths_data.PathsData(os.path.join('csv', 'data.csv'), self.params, follow_player=(example_idx == 3), advancing=(example_idx == 3 or example_idx == 2))
66+
self.paths_data = paths_data.PathsData('dota2.csv', self.params, follow_player=(example_idx == 3), advancing=(example_idx == 3 or example_idx == 2))
6867
# init the searched point with some random value - after first mouse move it's a
6968
self.paths_data.mouse_xy = ( ( numpy.random.rand(2) * 10 - 5 ) - numpy.asarray(self.canvas.size) / 2 ) * self.params.SCALE_FACTOR
7069

animation/params.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Params:
2+
SEGMENT_SIZE = 10
3+
TOP_PATHS_NUMBER = 5
4+
SAMPLE_SIZE = 150
5+
SCALE_FACTOR = 200
6+
TELEPORT_THRESHOLD = 40 # it defines a disatnce where we elimiate a segment - we skip all teleports
7+
8+
def __init__(self):
9+
self.VECTOR_POINT = int(self.SEGMENT_SIZE / 2)
10+
self.MOVE_ALONG_STEP_SIZE = int(self.SEGMENT_SIZE / 2)

0 commit comments

Comments
 (0)