Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ISBI2016-filaSimu-TM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vladimír Ulman
ISBI2016-filaSimu-TM
Commits
40c7a794
There was an error fetching the commit references. Please try again later.
Commit
40c7a794
authored
8 years ago
by
Vladimír Ulman
Browse files
Options
Downloads
Patches
Plain Diff
Finished rendering of the surface... very likely has some error!
parent
9189cf69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphics.cpp
+42
-12
42 additions, 12 deletions
src/graphics.cpp
with
42 additions
and
12 deletions
src/graphics.cpp
+
42
−
12
View file @
40c7a794
...
...
@@ -155,20 +155,47 @@ void ActiveMesh::displayQuadricSurface(void)
glBegin
(
GL_POINTS
);
glColor3f
(
0.0
f
,
1.0
f
,
0.0
f
);
//do the rendering
//
hmm... figure out some iteration model..
//
perhaps from surrounding points some interpolation
//do the rendering
, i.e., take incident triangles
//
and sample points from them and project
//
these points on the obtained surface
//FOR CYCLE BEGIN
Vector3F
point
;
//say we have x,y,z -> point
//adapt the point
GetClosestPointOnQuadricSurface
(
point
,
surf_coeff
);
//display the point
glVertex3f
(
point
.
x
,
point
.
y
,
point
.
z
);
//list of neigs triangle IDs
std
::
vector
<
size_t
>
neigsT
;
ulm
::
getVertexIncidentTriangles
(
*
this
,
VertexID
,
neigsT
);
//FOR CYCLE BEGIN
//over all triangles
for
(
unsigned
int
t
=
0
;
t
<
neigsT
.
size
();
++
t
)
{
//determine triangle vertices
const
Vector3FC
&
v1
=
Pos
[
ID
[
3
*
neigsT
[
t
]
+
0
]];
const
Vector3FC
&
v2
=
Pos
[
ID
[
3
*
neigsT
[
t
]
+
1
]];
const
Vector3FC
&
v3
=
Pos
[
ID
[
3
*
neigsT
[
t
]
+
2
]];
//sweep (coarsely!) across current triangle
for
(
float
c
=
0.1
f
;
c
<=
0.9
f
;
c
+=
0.1
f
)
for
(
float
b
=
0.1
f
;
b
<=
(
0.9
f
-
c
);
b
+=
0.1
f
)
{
float
a
=
1.0
f
-
b
-
c
;
Vector3F
point
=
a
*
v1
;
point
+=
b
*
v2
;
point
+=
c
*
v3
;
//backup...
Vector3F
origPoint
(
point
);
//adapt the point
std
::
cout
<<
"dist="
<<
GetClosestPointOnQuadricSurface
(
point
,
surf_coeff
);
//display the point
glVertex3f
(
point
.
x
,
point
.
y
,
point
.
z
);
std
::
cout
<<
"("
<<
origPoint
.
x
<<
","
<<
origPoint
.
y
<<
","
<<
origPoint
.
z
<<
") -> ("
<<
point
.
x
<<
","
<<
point
.
y
<<
","
<<
point
.
z
<<
")
\n
"
;
}
}
//FOR CYCLE END
glEnd
();
...
...
@@ -347,12 +374,15 @@ void keyboard(unsigned char key, int mx, int my)
case
'M'
:
showWholeMesh
^=
true
;
glutPostRedisplay
();
break
;
case
'V'
:
showVertexSurface
^=
true
;
glutPostRedisplay
();
break
;
case
'Q'
:
showQuadricSurface
^=
true
;
glutPostRedisplay
();
break
;
case
'i'
:
//inspect a cell
...
...
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
register
or
sign in
to comment