Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
090ec7e8
Commit
090ec7e8
authored
Feb 06, 2013
by
thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve bug with aligned points in explodeVolumeRender
parent
b753071a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
11 deletions
+129
-11
include/Algo/Render/GL2/explodeVolumeRender.hpp
include/Algo/Render/GL2/explodeVolumeRender.hpp
+129
-11
No files found.
include/Algo/Render/GL2/explodeVolumeRender.hpp
View file @
090ec7e8
...
@@ -128,15 +128,77 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
...
@@ -128,15 +128,77 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
Dart
e
=
map
.
phi1
(
a
);
Dart
e
=
map
.
phi1
(
a
);
VEC3
v2
=
Algo
::
Surface
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
e
,
positions
);
VEC3
v2
=
Algo
::
Surface
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
e
,
positions
);
VEC3
N
=
v1
^
v2
;
VEC3
N
=
v1
^
v2
;
N
.
normalize
();
double
l
=
N
.
norm
();
normals
.
push_back
(
N
);
if
(
l
>
0.000001
)
a
=
e
;
{
N
/=
l
;
normals
.
push_back
(
N
);
}
else
{
normals
.
push_back
(
VEC3
(
9
,
9
,
9
));
}
centerFace
+=
positions
[
a
];
centerFace
+=
positions
[
a
];
a
=
e
;
nbs
++
;
nbs
++
;
}
while
(
a
!=
d
);
}
while
(
a
!=
d
);
centerFace
/=
float
(
nbs
);
centerFace
/=
float
(
nbs
);
typename
std
::
vector
<
VEC3
>::
iterator
in
=
normals
.
begin
();
typename
std
::
vector
<
VEC3
>::
iterator
inb
=
normals
.
begin
();
typename
std
::
vector
<
VEC3
>::
iterator
inc
=
normals
.
begin
();
a
=
map
.
phi1
(
d
);
while
((
*
in
)[
0
]
>
1.0
)
{
a
=
map
.
phi1
(
a
);
++
in
;
}
inb
=
in
;
++
inb
;
Dart
b
=
map
.
phi1
(
a
);
while
((
*
inb
)[
0
]
>
1.0
)
{
b
=
map
.
phi1
(
b
);
++
inb
;
}
inc
=
inb
;
++
inc
;
Dart
c
=
map
.
phi1
(
b
);
while
((
*
inc
)[
0
]
>
1.0
)
{
c
=
map
.
phi1
(
c
);
++
inc
;
}
// loop to cut a polygon in triangle on the fly (works only with convex faces)
do
{
buffer
.
push_back
(
centerVolumes
[
a
]);
bufferColors
.
push_back
(
centerFace
);
bufferNormals
.
push_back
(
centerFace
);
// unsused just for fill
buffer
.
push_back
(
positions
[
a
]);
bufferColors
.
push_back
(
colorPerXXX
[
a
]);
bufferNormals
.
push_back
(
*
in
);
buffer
.
push_back
(
positions
[
b
]);
bufferColors
.
push_back
(
colorPerXXX
[
b
]);
bufferNormals
.
push_back
(
*
inb
);
buffer
.
push_back
(
positions
[
c
]);
bufferColors
.
push_back
(
colorPerXXX
[
c
]);
bufferNormals
.
push_back
(
*
inc
);
b
=
c
;
inb
=
inc
;
inc
++
;
c
=
map
.
phi1
(
b
);
while
((
*
inc
)[
0
]
>
1.0
)
{
c
=
map
.
phi1
(
c
);
++
inc
;
}
}
while
(
c
!=
a
);
/*
typename std::vector<VEC3>::iterator in = normals.begin();
typename std::vector<VEC3>::iterator in = normals.begin();
a = d;
a = d;
Dart b = map.phi1(a);
Dart b = map.phi1(a);
...
@@ -144,11 +206,11 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
...
@@ -144,11 +206,11 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
// loop to cut a polygon in triangle on the fly (works only with convex faces)
// loop to cut a polygon in triangle on the fly (works only with convex faces)
do
do
{
{
buffer
.
push_back
(
centerVolumes
[
d
]);
buffer.push_back(centerVolumes[
a
]);
bufferColors.push_back(centerFace);
bufferColors.push_back(centerFace);
bufferNormals.push_back(centerFace); // unsused just for fill
bufferNormals.push_back(centerFace); // unsused just for fill
buffer
.
push_back
(
positions
[
d
]);
buffer.push_back(positions[
a
]);
bufferColors
.
push_back
(
colorPerXXX
[
d
]);
bufferColors.push_back(colorPerXXX[
a
]);
bufferNormals.push_back(normals.back());
bufferNormals.push_back(normals.back());
buffer.push_back(positions[b]);
buffer.push_back(positions[b]);
bufferColors.push_back(colorPerXXX[b]);
bufferColors.push_back(colorPerXXX[b]);
...
@@ -158,7 +220,8 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
...
@@ -158,7 +220,8 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
bufferNormals.push_back(*in);
bufferNormals.push_back(*in);
b = c;
b = c;
c = map.phi1(b);
c = map.phi1(b);
}
while
(
c
!=
d
);
} while (c != a);
*/
}
}
...
@@ -248,7 +311,61 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
...
@@ -248,7 +311,61 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
}
while
(
a
!=
d
);
}
while
(
a
!=
d
);
centerFace
/=
float
(
nbs
);
centerFace
/=
float
(
nbs
);
typename
std
::
vector
<
VEC3
>::
iterator
in
=
normals
.
begin
();
typename
std
::
vector
<
VEC3
>::
iterator
inb
=
normals
.
begin
();
typename
std
::
vector
<
VEC3
>::
iterator
inc
=
normals
.
begin
();
a
=
map
.
phi1
(
d
);
while
((
*
in
)[
0
]
>
1.0
)
{
a
=
map
.
phi1
(
a
);
++
in
;
}
inb
=
in
;
++
inb
;
Dart
b
=
map
.
phi1
(
a
);
while
((
*
inb
)[
0
]
>
1.0
)
{
b
=
map
.
phi1
(
b
);
++
inb
;
}
inc
=
inb
;
++
inc
;
Dart
c
=
map
.
phi1
(
b
);
while
((
*
inc
)[
0
]
>
1.0
)
{
c
=
map
.
phi1
(
c
);
++
inc
;
}
// loop to cut a polygon in triangle on the fly (works only with convex faces)
do
{
buffer
.
push_back
(
centerVolumes
[
a
]);
bufferColors
.
push_back
(
centerFace
);
bufferNormals
.
push_back
(
centerFace
);
// unsused just for fill
buffer
.
push_back
(
positions
[
a
]);
bufferColors
.
push_back
(
m_globalColor
);
bufferNormals
.
push_back
(
*
in
);
buffer
.
push_back
(
positions
[
b
]);
bufferColors
.
push_back
(
m_globalColor
);
bufferNormals
.
push_back
(
*
inb
);
buffer
.
push_back
(
positions
[
c
]);
bufferColors
.
push_back
(
m_globalColor
);
bufferNormals
.
push_back
(
*
inc
);
b
=
c
;
inb
=
inc
;
inc
++
;
c
=
map
.
phi1
(
b
);
while
(
*
inc
[
0
]
>
1.0
)
{
c
=
map
.
phi1
(
c
);
++
inc
;
}
}
while
(
c
!=
a
);
/*
typename std::vector<VEC3>::iterator in = normals.begin();
typename std::vector<VEC3>::iterator in = normals.begin();
a = d;
a = d;
Dart b = map.phi1(a);
Dart b = map.phi1(a);
...
@@ -271,9 +388,10 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
...
@@ -271,9 +388,10 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttri
b = c;
b = c;
c = map.phi1(b);
c = map.phi1(b);
} while (c != d);
} while (c != d);
}
*/
}
m_nbTris
=
buffer
.
size
()
/
4
;
m_nbTris
=
buffer
.
size
()
/
4
;
m_vboPos
->
allocate
(
buffer
.
size
());
m_vboPos
->
allocate
(
buffer
.
size
());
...
...
Write
Preview
Markdown
is supported
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