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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
d90a7c09
Commit
d90a7c09
authored
Oct 02, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update on renderin for VR
parent
7aea3ea5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
8 deletions
+54
-8
include/Algo/Geometry/boundingbox.h
include/Algo/Geometry/boundingbox.h
+2
-0
include/Utils/drawer.h
include/Utils/drawer.h
+20
-2
include/Utils/gl_matrices.h
include/Utils/gl_matrices.h
+14
-2
src/Utils/drawer.cpp
src/Utils/drawer.cpp
+18
-4
No files found.
include/Algo/Geometry/boundingbox.h
View file @
d90a7c09
...
...
@@ -27,8 +27,10 @@
#include "Geometry/basic.h"
#include "Geometry/bounding_box.h"
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/traversorCell.h"
namespace
CGoGN
{
...
...
include/Utils/drawer.h
View file @
d90a7c09
...
...
@@ -106,13 +106,15 @@ public:
/**
* use as glVertex
* @return index of position for update
*/
void
vertex
(
const
Geom
::
Vec3f
&
v
);
unsigned
int
vertex
(
const
Geom
::
Vec3f
&
v
);
/**
* use as glVertex
* @return index of position for update
*/
void
vertex3f
(
float
x
,
float
y
,
float
z
);
unsigned
int
vertex3f
(
float
x
,
float
y
,
float
z
);
/**
* use as glColor
...
...
@@ -139,6 +141,22 @@ public:
*/
void
pointSize
(
float
ps
);
/**
* update position of VBO of drawer
* @param first index of vertex to update
* @param nb number of vertex tp update
* @param P ptr to table of vertices
*/
void
updatePositions
(
unsigned
int
first
,
unsigned
int
nb
,
const
Geom
::
Vec3f
*
P
);
/**
* update position of VBO of drawer
* @param first index of vertex to update
* @param nb number of vertex tp update
* @param P ptr to table of vertices
*/
void
updatePositions
(
unsigned
int
first
,
unsigned
int
nb
,
const
float
*
P
);
/**
* rendering in svg struct
*/
...
...
include/Utils/gl_matrices.h
View file @
d90a7c09
...
...
@@ -52,12 +52,18 @@ public:
void
popTransfo
()
{
if
(
m_stack
.
empty
())
return
;
if
(
m_stack
.
empty
())
return
;
m_matrices
[
2
]
=
m_stack
.
top
();
m_stack
.
pop
();
}
glm
::
mat4
getTransfo
()
const
const
glm
::
mat4
&
getTransfo
()
const
{
return
m_matrices
[
2
];
}
glm
::
mat4
&
getTransfo
()
{
return
m_matrices
[
2
];
}
...
...
@@ -82,6 +88,12 @@ public:
m_matrices
[
2
]
=
glm
::
scale
(
m_matrices
[
2
],
glm
::
vec3
(
s
,
s
,
s
));
}
void
apply
(
const
glm
::
mat4
&
m
)
{
m_matrices
[
2
]
=
m
*
m_matrices
[
2
];
}
};
...
...
src/Utils/drawer.cpp
View file @
d90a7c09
...
...
@@ -103,7 +103,7 @@ void Drawer::color3f(float r, float g, float b)
color
(
Geom
::
Vec3f
(
r
,
g
,
b
));
}
void
Drawer
::
vertex
(
const
Geom
::
Vec3f
&
v
)
unsigned
int
Drawer
::
vertex
(
const
Geom
::
Vec3f
&
v
)
{
if
(
m_dataPos
.
size
()
==
m_dataCol
.
size
())
{
...
...
@@ -112,13 +112,13 @@ void Drawer::vertex(const Geom::Vec3f& v)
else
m_dataCol
.
push_back
(
m_dataCol
.
back
());
}
m_dataPos
.
push_back
(
v
);
return
m_dataPos
.
size
()
-
1
;
}
void
Drawer
::
vertex3f
(
float
r
,
float
g
,
float
b
)
unsigned
int
Drawer
::
vertex3f
(
float
r
,
float
g
,
float
b
)
{
vertex
(
Geom
::
Vec3f
(
r
,
g
,
b
));
return
vertex
(
Geom
::
Vec3f
(
r
,
g
,
b
));
}
void
Drawer
::
newList
(
GLenum
comp
)
...
...
@@ -152,6 +152,20 @@ void Drawer::endList()
callList
();
}
void
Drawer
::
updatePositions
(
unsigned
int
first
,
unsigned
int
nb
,
const
Geom
::
Vec3f
*
P
)
{
m_vboPos
->
bind
();
glBufferSubData
(
GL_ARRAY_BUFFER
,
first
*
sizeof
(
Geom
::
Vec3f
),
nb
*
sizeof
(
Geom
::
Vec3f
),
P
);
}
void
Drawer
::
updatePositions
(
unsigned
int
first
,
unsigned
int
nb
,
const
float
*
P
)
{
m_vboPos
->
bind
();
glBufferSubData
(
GL_ARRAY_BUFFER
,
first
*
3
*
sizeof
(
float
),
nb
*
3
*
sizeof
(
float
),
P
);
}
void
Drawer
::
callList
()
{
if
(
m_begins
.
empty
())
...
...
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