Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philipp Auersperg
kivy.orientation
Commits
dcf2a422
Commit
dcf2a422
authored
7 years ago
by
Philipp Auersperg
Browse files
Options
Download
Email Patches
Plain Diff
calibration ann eingegeben werden
parent
db96d5a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/OrientationDemo-0.4-debug.apk
+0
-0
bin/OrientationDemo-0.4-debug.apk
cam.py
+1
-9
cam.py
main.py
+21
-2
main.py
with
22 additions
and
11 deletions
+22
-11
bin/OrientationDemo-0.4-debug.apk
+
0
-
0
View file @
dcf2a422
No preview for this file type
This diff is collapsed.
Click to expand it.
cam.py
+
1
-
9
View file @
dcf2a422
...
...
@@ -43,7 +43,6 @@ try:
accel_info:accel_info
gps_pos:gps_pos
btn_lifeview:btn_lifeview
# camera:camera
BoxLayout:
orientation:'vertical'
size_hint:.9,1
...
...
@@ -64,14 +63,6 @@ try:
BoxLayout:
id:camera_space
size_hint:1,1
# Camera:
# id: camera
# # resolution: (640, 480)
# # resolution:(1280,960)
# resolution:(3264,1836)
#
# play: False
# size_hint:1,1
BoxLayout:
size_hint:1,None
ToggleButton:
...
...
@@ -161,6 +152,7 @@ class CameraClick(BoxLayout):
print
'cam added:'
,
self
.
camera
.
resolution
else
:
print
'warning: no cam'
@
property
def
camera_active
(
self
):
cam
=
self
.
camera
...
...
This diff is collapsed.
Click to expand it.
main.py
+
21
-
2
View file @
dcf2a422
...
...
@@ -161,10 +161,11 @@ Builder.load_string("""
<CamWindow>:
orientation:'vertical'
cam:cam
CameraClick:
id:cam
size_hint:1,.9
resolution:(1280,960)
#
resolution:(1280,960)
BoxLayout:
size_hint:1,.1
...
...
@@ -175,6 +176,10 @@ Builder.load_string("""
Button:
text:'stop'
on_release:root.on_stop()
TextInput:
id:fov
text:'1185'
"""
)
class
CamWindow
(
BoxLayout
):
...
...
@@ -207,13 +212,27 @@ class CamWindow(BoxLayout):
def
on_accel
(
self
,
*
a
):
self
.
draw_cube
()
@
property
def
fov
(
self
):
return
float
(
self
.
ids
.
fov
.
text
)
@
property
def
fov_corrected
(
self
):
"""fov corrected if camera window size != camera resolution"""
print
self
.
cam
.
camera
.
resolution
,
self
.
painter
.
widget
.
size
res
=
float
(
self
.
painter
.
widget
.
width
)
/
self
.
cam
.
camera
.
resolution
[
0
]
*
self
.
fov
print
'res:'
,
res
return
res
def
draw_cube
(
self
):
try
:
distance
=
float
(
self
.
cam
.
distance
.
text
)
except
ValueError
:
distance
=
7
self
.
painter
.
draw_cube
(
self
.
accel
,
fx
=
1185
,
sl
=
1
,
distance
=
distance
,
front_at_center
=
True
)
self
.
fov_corrected
self
.
painter
.
draw_cube
(
self
.
accel
,
fx
=
self
.
fov_corrected
,
sl
=
1
,
distance
=
distance
,
front_at_center
=
True
)
def
on_start
(
self
):
print
self
.
accel
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help