Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
fb0c2084
Commit
fb0c2084
authored
Jan 12, 2011
by
Ansgar Philippsen
Browse files
Options
Downloads
Patches
Plain Diff
tweaked non-tube trace rendering
parent
591242f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gfx/src/impl/cartoon_renderer.cc
+12
-9
12 additions, 9 deletions
modules/gfx/src/impl/cartoon_renderer.cc
with
12 additions
and
9 deletions
modules/gfx/src/impl/cartoon_renderer.cc
+
12
−
9
View file @
fb0c2084
...
...
@@ -452,12 +452,14 @@ void CartoonRenderer::RebuildSplineObj(IndexedVertexArray& va,
double
psized
=
static_cast
<
double
>
(
psize
);
float
of
=
static_cast
<
float
>
(
psize
)
/
(
2.0
*
M_PI
);
for
(;
sc
<
slist
.
size
();
++
sc
)
{
//double dd=geom::Dot(slist.at(sc-1).normal,slist.at(sc).normal);
size_t
offset
=
0
;
if
(
slist
.
at
(
sc
).
type
==
0
)
{
geom
::
Vec3
dir
=
slist
.
at
(
sc
).
position
-
slist
.
at
(
sc
-
1
).
position
;
double
ang
=-
geom
::
SignedAngle
(
geom
::
Cross
(
slist
.
at
(
sc
-
1
).
normal
,
dir
),
geom
::
Cross
(
slist
.
at
(
sc
).
normal
,
dir
),
dir
);
size_t
offset
=
psize
+
static_cast
<
size_t
>
(
round
(
ang
*
of
)
+
psized
);
offset
=
psize
+
static_cast
<
size_t
>
(
round
(
ang
*
of
)
+
psized
);
}
if
(
slist
.
at
(
sc
).
type
==
3
)
{
if
(
slist
.
at
(
sc
-
1
).
type
!=
3
)
{
// boundary to arrow
...
...
@@ -718,9 +720,10 @@ namespace {
for
(
unsigned
int
i
=
0
;
i
<
d4
;
++
i
)
{
unsigned
int
p1
=
(
d4
+
i
-
1
)
%
d4
;
unsigned
int
p2
=
(
i
+
1
)
%
d4
;
float
dx
=
prof
[
p2
].
v
[
0
]
-
prof
[
p1
].
v
[
0
];
float
dy
=
prof
[
p2
].
v
[
1
]
-
prof
[
p1
].
v
[
1
];
prof
[
i
].
n
=
geom
::
Normalize
(
geom
::
Vec3
(
dy
,
-
dx
,
0.0
));
float
f1
=
geom
::
Length2
(
prof
[
p1
].
v
-
prof
[
i
].
v
);
float
f2
=
geom
::
Length2
(
prof
[
p2
].
v
-
prof
[
i
].
v
);
geom
::
Vec3
s
=
f2
*
(
prof
[
p2
].
v
-
prof
[
i
].
v
)
-
f1
*
(
prof
[
p1
].
v
-
prof
[
i
].
v
);
prof
[
i
].
n
=
geom
::
Normalize
(
geom
::
Vec3
(
s
[
1
],
-
s
[
0
],
0.0
));
}
return
prof
;
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment