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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
4faeed7a
Commit
4faeed7a
authored
Feb 17, 2011
by
Kenneth Vanhoey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrections et ameliorations decimation lightfield
parent
ec1c89e8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
31 deletions
+43
-31
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+26
-18
include/Geometry/vector_gen.hpp
include/Geometry/vector_gen.hpp
+8
-8
include/Utils/quadricRGBfunctions.h
include/Utils/quadricRGBfunctions.h
+1
-1
include/Utils/quadricRGBfunctions.hpp
include/Utils/quadricRGBfunctions.hpp
+8
-4
No files found.
include/Algo/Decimation/lightfieldApproximator.hpp
View file @
4faeed7a
...
...
@@ -66,7 +66,8 @@ void Approximator_Frame<PFP>::approximate(Dart d)
VEC3
segmentNew
=
m_approxPosition
[
d
]
;
segmentNew
-=
this
->
m_position
[
d
]
;
REAL
t
=
std
::
max
(
std
::
min
(
segment
*
segmentNew
,
REAL
(
1
))
,
REAL
(
0
)
)
;
// Orthogonal projection on segment v1-v2 of new vertex
REAL
t
=
(
segment
*
segmentNew
)
/
(
segment
.
norm
()
*
segment
.
norm
())
;
t
=
std
::
max
(
std
::
min
(
t
,
REAL
(
1
))
,
REAL
(
0
)
)
;
// Orthogonal projection on segment v1-v2 of new vertex
VEC3
n1
,
n2
;
this
->
m_attrV
[
d
].
getSubVectorH
(
2
,
0
,
n1
)
;
...
...
@@ -81,10 +82,14 @@ void Approximator_Frame<PFP>::approximate(Dart d)
VEC3
newJ
=
newN
^
newI
;
newJ
.
normalize
()
;
assert
(
this
->
m_approx
[
d
].
setSubVectorH
(
0
,
0
,
newI
)
||
!
"Approximator_Frame::approximate"
)
;
assert
(
this
->
m_approx
[
d
].
setSubVectorH
(
1
,
0
,
newJ
)
||
!
"Approximator_Frame::approximate"
)
;
assert
(
this
->
m_approx
[
d
].
setSubVectorH
(
2
,
0
,
newN
)
||
!
"Approximator_Frame::approximate"
)
;
if
(
!
this
->
m_approx
[
d
].
setSubVectorH
(
0
,
0
,
newI
)
||
!
this
->
m_approx
[
d
].
setSubVectorH
(
1
,
0
,
newJ
)
||
!
this
->
m_approx
[
d
].
setSubVectorH
(
2
,
0
,
newN
)
)
assert
(
!
"Approximator_Frame::approximate"
)
;
}
// AutoAttributeHandler<VEC3> normals = this->m_map.template getAttribute<VEC3>(VERTEX_ORBIT, "normals") ;
// this->m_approx[d].getSubVectorH(2,0,normals[d]) ;
}
/************************************************************************************
...
...
@@ -130,21 +135,24 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
m_frame
[
dd
].
getSubVectorH
(
2
,
0
,
n2
)
;
VEC3
j1pr
=
n1
^
i
;
j1pr
.
normalize
()
;
VEC3
j2pr
=
n2
^
i
;
REAL
alpha1
=
((
n
*
j1pr
)
>
0
?
1
:
-
1
)
*
acos
(
n
*
n1
)
;
REAL
alpha2
=
((
n
*
j2pr
)
>
0
?
1
:
-
1
)
*
acos
(
n
*
n2
)
;
REAL
gamma1
=
((
j1
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
i1
*
i
)
;
REAL
gamma2
=
((
j2
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
i2
*
i
)
;
alpha1
=
std
::
min
(
REAL
(
1
),
std
::
max
(
REAL
(
-
1
),
alpha1
))
;
alpha2
=
std
::
min
(
REAL
(
1
),
std
::
max
(
REAL
(
-
1
),
alpha2
))
;
gamma1
=
std
::
min
(
REAL
(
1
),
std
::
max
(
REAL
(
-
1
),
gamma1
))
;
gamma2
=
std
::
min
(
REAL
(
1
),
std
::
max
(
REAL
(
-
1
),
gamma2
))
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
alpha1
,
gamma1
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
alpha2
,
gamma2
)
;
j2pr
.
normalize
()
;
// Rotation dans sens trigo dans le plan tangent autour de n (i1->i)
REAL
gamma1
=
((
j1
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
i1
*
i
),
-
1.0
f
))
;
// angle positif ssi
REAL
gamma2
=
((
j2
*
i
)
>
0
?
1
:
-
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
i2
*
i
),
-
1.0
f
))
;
// -PI/2 < angle(i,j1) < PI/2 ssi i*j1 > 0
// Rotation dans le sens trigo autour de l'axe i (n1->n)
REAL
alpha1
=
((
n
*
j1pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n1
),
-
1.0
f
)
)
;
// angle positif ssi
REAL
alpha2
=
((
n
*
j2pr
)
>
0
?
-
1
:
1
)
*
acos
(
std
::
max
(
std
::
min
(
1.0
f
,
n
*
n2
),
-
1.0
f
)
)
;
// PI/2 < angle(j1',n) < -PI/2 ssi j1'*n < 0
assert
(
-
3.15
<
gamma1
&&
gamma1
<=
3.15
)
;
assert
(
-
3.15
<
gamma2
&&
gamma2
<=
3.15
)
;
assert
(
-
3.15
<
alpha1
&&
alpha1
<=
3.15
)
;
assert
(
-
3.15
<
alpha2
&&
alpha2
<=
3.15
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha1
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
// New RGBf
if
(
!
(
*
m_quadricRGBfunctions
)[
d
].
findOptimizedRGBfunctions
(
this
->
m_approx
[
d
]))
...
...
include/Geometry/vector_gen.hpp
View file @
4faeed7a
...
...
@@ -320,17 +320,17 @@ template <unsigned int DIM, typename T>
inline
Vector
<
DIM
,
T
>
slerp
(
const
Vector
<
DIM
,
T
>
&
v1
,
const
Vector
<
DIM
,
T
>
&
v2
,
const
T
&
t
)
{
Vector
<
DIM
,
T
>
res
;
T
omega
=
acos
(
v1
*
v2
);
T
den
=
sin
(
omega
);
T
omega
=
acos
(
v1
*
v2
)
;
T
den
=
sin
(
omega
)
;
if
(
-
1e-8
<
den
||
den
<
1e-8
)
return
v1
;
if
(
-
1e-8
<
den
&&
den
<
1e-8
)
return
t
<
0.5
?
v1
:
v2
;
T
f1
=
sin
((
T
(
1
)
-
t
)
*
omega
)
/
den
;
T
f2
=
sin
(
t
*
omega
)
/
den
;
T
f1
=
sin
((
T
(
1
)
-
t
)
*
omega
)
/
den
;
T
f2
=
sin
(
t
*
omega
)
/
den
;
res
+=
f1
*
v1
;
res
+=
f2
*
v2
;
res
+=
f1
*
v1
;
res
+=
f2
*
v2
;
return
res
;
}
...
...
include/Utils/quadricRGBfunctions.h
View file @
4faeed7a
...
...
@@ -41,7 +41,7 @@ public:
QuadricRGBfunctions
();
QuadricRGBfunctions
(
int
i
);
QuadricRGBfunctions
(
const
QuadricRGBfunctions
&
);
QuadricRGBfunctions
(
const
RGBFUNCTIONS
&
,
REAL
alpha
=
REAL
(
0
),
REAL
gamm
a
=
REAL
(
0
));
QuadricRGBfunctions
(
const
RGBFUNCTIONS
&
,
REAL
gamma
=
REAL
(
0
),
REAL
alph
a
=
REAL
(
0
));
virtual
~
QuadricRGBfunctions
();
...
...
include/Utils/quadricRGBfunctions.hpp
View file @
4faeed7a
...
...
@@ -45,7 +45,7 @@ QuadricRGBfunctions<REAL>::QuadricRGBfunctions(const QuadricRGBfunctions& q) {
}
template
<
typename
REAL
>
QuadricRGBfunctions
<
REAL
>::
QuadricRGBfunctions
(
const
RGBFUNCTIONS
&
cf
,
REAL
alpha
,
REAL
gamm
a
)
{
QuadricRGBfunctions
<
REAL
>::
QuadricRGBfunctions
(
const
RGBFUNCTIONS
&
cf
,
REAL
gamma
,
REAL
alph
a
)
{
MATRIX66
R1
,
R2_A
,
R2_b
,
R2_c
;
// Matrice de rotation 1
buildRotateMatrix
(
R1
,
gamma
);
...
...
@@ -66,7 +66,9 @@ QuadricRGBfunctions<REAL>::QuadricRGBfunctions(const RGBFUNCTIONS& cf, REAL alph
// Rotation 1
Geom
::
Vector
<
6
,
REAL
>
function
;
assert
(
cf
.
getSubVectorH
(
col
,
0
,
function
)
||
!
"QuadricRGBfunctions::constructor"
)
;
if
(
!
cf
.
getSubVectorH
(
col
,
0
,
function
))
assert
(
!
"QuadricRGBfunctions::constructor"
)
;
VEC6
coefs
=
R1
*
function
;
// Multiply coefs
...
...
@@ -92,7 +94,8 @@ REAL QuadricRGBfunctions<REAL>::operator() (const RGBFUNCTIONS& cf) const {
for
(
unsigned
col
=
RED
;
col
<
BLUE
+
1
;
++
col
)
{
Geom
::
Vector
<
6
,
REAL
>
function
;
assert
(
cf
.
getSubVectorH
(
col
,
0
,
function
)
||
!
"QuadricRGBfunctions::operator()"
)
;
if
(
!
cf
.
getSubVectorH
(
col
,
0
,
function
))
assert
(
!
"QuadricRGBfunctions::getSubVectorH"
)
;
VEC6
Al
=
A
[
col
]
*
function
;
...
...
@@ -123,7 +126,8 @@ bool QuadricRGBfunctions<REAL>::findOptimizedRGBfunctions(RGBFUNCTIONS& cf) cons
coefs
=
Ainv
*
b
[
col
];
assert
(
cf
.
setSubVectorH
(
col
,
0
,
coefs
)
||
!
"QuadricRGBfunctions::findOptimizedRGBfunctions(cf) setSubVector failed"
)
;
if
(
!
cf
.
setSubVectorH
(
col
,
0
,
coefs
))
assert
(
!
"QuadricRGBfunctions::findOptimizedRGBfunctions(cf) setSubVector failed"
)
;
}
return
true
;
...
...
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