Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
858644b6
Commit
858644b6
authored
Feb 20, 2012
by
hengli
Browse files
Made trail colors brighter.
parent
eea6afda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/map3D/Pixhawk3DWidget.cc
View file @
858644b6
...
...
@@ -163,10 +163,21 @@ Pixhawk3DWidget::localPositionChanged(UASInterface* uas, int component,
systemData
.
trailIndexMap
().
insert
(
component
,
systemData
.
trailMap
().
size
()
-
1
);
osg
::
Vec4
color
((
float
)
qrand
()
/
RAND_MAX
,
(
float
)
qrand
()
/
RAND_MAX
,
(
float
)
qrand
()
/
RAND_MAX
,
0.5
);
// generate nice bright random color
float
golden_ratio_conjugate
=
0.618033988749895
f
;
float
h
=
(
float
)
qrand
()
/
RAND_MAX
+
golden_ratio_conjugate
;
if
(
h
>
1.0
f
)
{
h
-=
1.0
f
;
}
QColor
colorHSV
;
colorHSV
.
setHsvF
(
h
,
0.99
,
0.99
,
0.5
);
QColor
colorRGB
=
colorHSV
.
toRgb
();
osg
::
Vec4f
color
(
colorRGB
.
redF
(),
colorRGB
.
greenF
(),
colorRGB
.
blueF
(),
colorRGB
.
alphaF
());
systemData
.
trailNode
()
->
addDrawable
(
createTrail
(
color
));
systemData
.
trailNode
()
->
addDrawable
(
createLink
(
uas
->
getColor
()));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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