Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
VR-demos
Commits
a899b46e
Commit
a899b46e
authored
Apr 11, 2018
by
Ruben Jesus Garcia Hernandez
Browse files
Scale volumetric data according to unit cell if present.
Useful for time evolution data (conversion from cube to xyz)
parent
342eb562
Changes
4
Hide whitespace changes
Inline
Side-by-side
CAVE/NOMADCaveT/src/main.cpp
View file @
a899b46e
...
...
@@ -387,12 +387,17 @@ bool er;
plyfiles
[
p
%
ISOS
]);
float
mat
[
16
];
glm
::
mat4
matFinal
,
matcubetrans
,
mvs
,
sc
,
sctrans
;
if
(
voxelSize
[
0
]
!=-
1
)
{
if
(
voxelSize
[
0
]
!=-
1
||
has_abc
)
{
//We scale in RenderUnitCell by globalscaling so that atoms look large enough on the cave.
//So we need to scale here as well.
mvs
=
glm
::
scale
(
mvs
,
glm
::
vec3
(
globalscaling
*
scaling
/
(
float
)
voxelSize
[
0
],
if
(
voxelSize
[
0
]
!=-
1
)
mvs
=
glm
::
scale
(
mvs
,
glm
::
vec3
(
globalscaling
*
scaling
/
(
float
)
voxelSize
[
0
],
globalscaling
*
scaling
/
(
float
)
voxelSize
[
1
],
globalscaling
*
scaling
/
(
float
)
voxelSize
[
2
]));
else
mvs
=
glm
::
scale
(
mvs
,
glm
::
vec3
(
globalscaling
*
scaling
,
globalscaling
*
scaling
,
globalscaling
*
scaling
));
matcubetrans
=
glm
::
translate
(
matcubetrans
,
glm
::
vec3
(
cubetrans
[
0
],
cubetrans
[
1
],
cubetrans
[
2
]));
glm
::
mat4
abcm
(
abc
[
0
][
0
],
abc
[
0
][
1
],
abc
[
0
][
2
],
0
,
...
...
GoogleCardboardAndroid/NOMADgvrT/src/main/jni/treasure_hunt_renderer.cc
View file @
a899b46e
...
...
@@ -496,10 +496,14 @@ glGenTextures(2+ZLAYERS, textDepthPeeling);
plyfiles
[
p
%
ISOS
]);
gvr
::
Mat4f
trans
;
gvr
::
Mat4f
matFinal
,
matcubetrans
,
mvs
,
sc
,
sctrans
;
if
(
voxelSize
[
0
]
!=-
1
)
{
mvs
=
ScalingMatrix
(
scaling
/
(
float
)
voxelSize
[
0
],
scaling
/
(
float
)
voxelSize
[
1
],
scaling
/
(
float
)
voxelSize
[
2
]);
if
(
voxelSize
[
0
]
!=-
1
||
has_abc
)
{
if
(
voxelSize
[
0
]
==-
1
)
mvs
=
ScalingMatrix
(
scaling
);
else
mvs
=
ScalingMatrix
(
scaling
/
(
float
)
voxelSize
[
0
],
scaling
/
(
float
)
voxelSize
[
1
],
scaling
/
(
float
)
voxelSize
[
2
]);
matcubetrans
=
TranslationMatrix
(
cubetrans
);
gvr
::
Mat4f
abcm
{
abc
[
0
][
0
],
abc
[
0
][
1
],
abc
[
0
][
2
],
0
,
abc
[
1
][
0
],
abc
[
1
][
1
],
abc
[
1
][
2
],
0
,
...
...
OculusMobile/NOMADGearvrT/Src/OvrApp.cpp
View file @
a899b46e
...
...
@@ -282,10 +282,13 @@ void OvrApp::OneTimeInit( const char * fromPackage, const char * launchIntentJSO
translations[p%ISOS][2]);
*/
//gvr
if
(
voxelSize
[
0
]
!=-
1
)
{
if
(
voxelSize
[
0
]
!=-
1
||
has_abc
)
{
Matrix4f
mvs
,
abcm
,
matcubetrans
,
sctrans
,
sc
;
mvs
=
Matrix4f
::
Scaling
(
scaling
/
(
float
)
voxelSize
[
0
],
scaling
/
(
float
)
voxelSize
[
1
],
scaling
/
(
float
)
voxelSize
[
2
]);
if
(
voxelSize
[
0
]
==-
1
)
mvs
=
Matrix4f
::
Scaling
(
scaling
);
else
mvs
=
Matrix4f
::
Scaling
(
scaling
/
(
float
)
voxelSize
[
0
],
scaling
/
(
float
)
voxelSize
[
1
],
scaling
/
(
float
)
voxelSize
[
2
]);
matcubetrans
=
Matrix4f
::
Translation
(
cubetrans
[
0
],
cubetrans
[
1
],
cubetrans
[
2
]);
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
...
...
OpenVR/TimestepData/hellovr_opengl_main.cpp
View file @
a899b46e
...
...
@@ -1687,8 +1687,9 @@ void CMainApplication::SetupIsosurfaces()
Matrix4
matFinal
;
//matFinal.translate(translations[p%ISOS][0]+cubetrans[0], translations[p%ISOS][1]+cubetrans[1], translations[p%ISOS][2]+cubetrans[2]);
Matrix4
matcubetrans
,
mvs
;
if
(
voxelSize
[
0
]
!=-
1
)
{
mvs
.
scale
(
1.0
f
/
(
float
)
voxelSize
[
0
],
1.0
f
/
(
float
)
voxelSize
[
1
],
1.0
f
/
(
float
)
voxelSize
[
2
]);
if
(
voxelSize
[
0
]
!=-
1
||
has_abc
)
{
if
(
voxelSize
[
0
]
!=-
1
)
mvs
.
scale
(
1.0
f
/
(
float
)
voxelSize
[
0
],
1.0
f
/
(
float
)
voxelSize
[
1
],
1.0
f
/
(
float
)
voxelSize
[
2
]);
matcubetrans
.
translate
(
cubetrans
[
0
],
cubetrans
[
1
],
cubetrans
[
2
]);
//angstrom
//if abc, in abc coordinates
/*Matrix4 abcm (abc[0][0], abc[1][0], abc[2][0], 0,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment