[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./Makefile gfx/libpaper/Paper.cxx gfx/libpa...
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz ./Makefile gfx/libpaper/Paper.cxx gfx/libpa... |
Date: |
Thu, 10 Oct 2002 02:28:53 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 02/10/10 02:28:53
Modified files:
. : Makefile
gfx/libpaper : Paper.cxx Paper.hxx
Log message:
Cleaning Paperpass
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.188&tr2=1.189&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.cxx.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/Paper.hxx.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: gzz/Makefile
diff -c gzz/Makefile:1.188 gzz/Makefile:1.189
*** gzz/Makefile:1.188 Thu Oct 10 01:10:21 2002
--- gzz/Makefile Thu Oct 10 02:28:52 2002
***************
*** 392,398 ****
$(GLLIB) $(JYTHON) -Dgzzclient=gl test/test.py jni
runtest: # Use: make runtest TEST=gzz/vob/vobmatcher, to run a single test.
$(GLLIB) $(JYTHON) test/testutil.py $(DBG) test/$(TEST).test
! runtest-gl: # In JNI-dependent test's requestJNI must be defined.
$(GLLIB) $(JYTHON) test/testutil.py -Dgzzclient=gl $(DBG) jni
test/$(TEST).test
run:
$(JYTHON) Gzz.py $(DBG) -Dgzzclient=awt $(Z)
--- 392,398 ----
$(GLLIB) $(JYTHON) -Dgzzclient=gl test/test.py jni
runtest: # Use: make runtest TEST=gzz/vob/vobmatcher, to run a single test.
$(GLLIB) $(JYTHON) test/testutil.py $(DBG) test/$(TEST).test
! runtest-gl:
$(GLLIB) $(JYTHON) test/testutil.py -Dgzzclient=gl $(DBG) jni
test/$(TEST).test
run:
$(JYTHON) Gzz.py $(DBG) -Dgzzclient=awt $(Z)
Index: gzz/gfx/libpaper/Paper.cxx
diff -c gzz/gfx/libpaper/Paper.cxx:1.15 gzz/gfx/libpaper/Paper.cxx:1.16
*** gzz/gfx/libpaper/Paper.cxx:1.15 Wed Oct 2 06:33:45 2002
--- gzz/gfx/libpaper/Paper.cxx Thu Oct 10 02:28:53 2002
***************
*** 1,4 ****
! #include "Paper.hxx"
#include <sstream>
--- 1,4 ----
! hwo todd#include "Paper.hxx"
#include <sstream>
***************
*** 9,16 ****
namespace Paper {
- bool useVertexProgram = true;
-
TexGen::TexGen(const float *tex_mat) {
this->tex_mat[0] = tex_mat[0];
this->tex_mat[1] = tex_mat[1];
--- 9,14 ----
***************
*** 189,195 ****
}
void TexGenEmboss::setUp_explicit(LightParam * param) {
! std::cerr << "Warning: setUp_explicit for TexGenEmboss not implemented
yet";
explicit_mat = tex_mat;
}
--- 187,247 ----
}
void TexGenEmboss::setUp_explicit(LightParam * param) {
! /** Does some as TexGenEmboss::setUp_VP, but without
! * using vertex programs. In other words, calculates
! * translation matrix for translating paper position
! * into embossed texture coordinates.
! *
! * Proper translation matrix is T A^-1 E^-1 A (see
! * TexGenEmboss::setUp_VP for details) and it's stored
! * into float TexGenEmboss::explicit_tmp_mat[16].
! */
!
! /** Implementing under progress O:-)
!
! // Matrix E
! float eps = this->eps * param->e2.dot(param->e2)
! / (param->Light - param->Light_w * param->orig).dot(param->e2);
!
! float transl_mat[16] = { 1, 0, 0, eps * param->Light.x,
! 0, 1, 0, eps * param->Light.y,
! 0, 0, 1, eps * param->Light.z,
! 0, 0, 0, 1};
!
! float s = 1 - param->Light_w * eps;
!
! float scale_mat[16] = { s, 0, 0, 0,
! 0, s, 0, 0,
! 0, 0, s, 0,
! 0, 0, 0, 1};
!
! // Matrix A
! float p2v_mat[16] = { param->e0.x, param->e0.y, param->e0.z, 0,
! param->e1.x, param->e1.y, param->e1.z, 0,
! param->e2.x, param->e2.y, param->e2.z, 0,
! param->orig.x, param->orig.y, param->orig.z, 1 };
!
! */
!
! /** We don't have Matrix invertion or multiplications routines yet...
!
! // Matrix E
! float emb_map_mat[16] = matrix_multiplication(transl_mat, scale_mat);
! // Matrix E^-1
! invert_translation_matrix(emb_map_mat);
!
! // Matrix E^-1 A
! float tmp_mat[16] = matrix_multiplication(emb_map_mat, p2v_mat);
! // Matrix A^-1
! invert_translation_matrix(p2v_mat);
! // Matrix T A^-1
! float tmp_mat2[16] = matrix_multiplication(tex_mat, p2v_mat);
! // Matrix T A^-1 E^-1 A
! explicit_tmp_map = matrix_multiplication(tmp_mat2, tmp_mat);
! // explicit_mat shoulde be made to point explicit_tmp_map
! */
!
! std::cerr << "Warning: TexGenEmboss::setUp_explicit() not yet
implemented!\n";
explicit_mat = tex_mat;
}
***************
*** 337,343 ****
}
}
! void PaperPass::vertex_explicit(float *ppos) {
const float *mat;
float texCoords[4];
--- 389,395 ----
}
}
! void PaperPass::texcoords_explicit(float *ppos) {
const float *mat;
float texCoords[4];
Index: gzz/gfx/libpaper/Paper.hxx
diff -c gzz/gfx/libpaper/Paper.hxx:1.13 gzz/gfx/libpaper/Paper.hxx:1.14
*** gzz/gfx/libpaper/Paper.hxx:1.13 Mon Sep 30 02:44:22 2002
--- gzz/gfx/libpaper/Paper.hxx Thu Oct 10 02:28:53 2002
***************
*** 19,28 ****
* backgrounds.
*/
namespace Paper {
-
- /** Toggles (after 0.8Alpha4) the use of vertex program extension. */
- extern bool useVertexProgram;
-
using namespace Vec23;
/** Specifies texture coordinate system and
--- 19,24 ----
***************
*** 100,106 ****
float tex_mat[16];
public:
! /** Pointer to current translation matrix used in vertex_explicit(). */
const float *explicit_mat;
/** Creates a new TexGen.
--- 96,102 ----
float tex_mat[16];
public:
! /** Pointer to current translation matrix used in texcoords_explicit(). */
const float *explicit_mat;
/** Creates a new TexGen.
***************
*** 130,137 ****
protected:
/** Amount to shift the texture towards the light. */
float eps;
! /** When embossing (depends of LightParam), vertex_explicit() needs
! * a different matrix to transform paper position into texture
coordinates.
*/
float explicit_tmp_mat[16];
--- 126,134 ----
protected:
/** Amount to shift the texture towards the light. */
float eps;
! /** When embossing (depends of LightParam), texcoords_explicit() needs
! * a different matrix to transform paper position into embossed
! * texture coordinates.
*/
float explicit_tmp_mat[16];
***************
*** 188,194 ****
*
* 3) using explicit coordinates
* - call setUp_explicit with LightParam to use
! * - call vertex_explicit() with paper coordinates in
* arrays of 4 floats and call glVertex*() directly
* from the context.
* - call teardown_explicit()
--- 185,191 ----
*
* 3) using explicit coordinates
* - call setUp_explicit with LightParam to use
! * - call texcoords_explicit() with paper coordinates in
* arrays of 4 floats and call glVertex*() directly
* from the context.
* - call teardown_explicit()
***************
*** 244,253 ****
* @param ppos position within paper (array of 4 floats)
*/
void vertex_VP(float *pos, float *ppos) {
! vertex_VP(ppos);
glVertex4fv(pos);
}
! void vertex_VP(float *ppos) {
glTexCoord4fv(ppos);
}
--- 241,250 ----
* @param ppos position within paper (array of 4 floats)
*/
void vertex_VP(float *pos, float *ppos) {
! texcoords_VP(ppos);
glVertex4fv(pos);
}
! void texcoords_VP(float *ppos) {
glTexCoord4fv(ppos);
}
***************
*** 262,270 ****
*/
void tearDown_explicit () { teardowncode(); }
! /** Explicit version of the PaperPass vertex.
*/
! void vertex_explicit(float *ppos);
protected:
/* Vertex program code. */
--- 259,267 ----
*/
void tearDown_explicit () { teardowncode(); }
! /** Explicit version of the PaperPass texcoords.
*/
! void texcoords_explicit(float *ppos);
protected:
/* Vertex program code. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./Makefile gfx/libpaper/Paper.cxx gfx/libpa...,
Asko Soukka <=