778 |
TextRenderer *r; |
TextRenderer *r; |
779 |
unistring txt; |
unistring txt; |
780 |
ZPt origin; |
ZPt origin; |
781 |
float scale; |
float h1; |
782 |
""", |
""", |
783 |
"Params" : """ |
"Params" : """ |
784 |
Font f, |
Font f, |
785 |
String text, float x, float y, float z, |
String text, float x, float y, float z, |
786 |
float scale |
float h1 |
787 |
""", |
""", |
788 |
"ParamCode" : """ |
"ParamCode" : """ |
789 |
r = f; |
r = f; |
790 |
txt = text; origin.x = x; origin.y = y; origin.z = z; |
txt = text; origin.x = x; origin.y = y; origin.z = z; |
791 |
this->scale = scale; |
this->h1 = h1; |
792 |
""", |
""", |
793 |
"ExtraClass" : """ |
"ExtraClass" : """ |
794 |
template<class Coords> struct Vertexer { |
template<class Coords> struct Vertexer { |
799 |
template<class T> void operator()(const T &x, const T &y) { |
template<class T> void operator()(const T &x, const T &y) { |
800 |
ZPt tmp(x * scale, y * scale, 0); |
ZPt tmp(x * scale, y * scale, 0); |
801 |
c.vertex(tmp); |
c.vertex(tmp); |
802 |
|
DBG(dbg_horiztext2) << "Vertex: "<<x<<" "<<y<<" "<<tmp<<" "<<c.transform(tmp) |
803 |
|
<< "\\n"; |
804 |
} |
} |
805 |
}; |
}; |
806 |
""", |
""", |
807 |
"RenderCode" : """ |
"RenderCode" : """ |
808 |
Coords *coords2inv = coords2.getInverse(); |
Coords *coords2inv = coords2.getInverse(); |
809 |
ZPt orig = coords2inv->transform(coords1.transform(origin)); |
ZPt orig = coords2inv->transform(coords1.transform(origin)); |
810 |
|
ZPt h = coords2inv->transform(coords1.transform(origin+ZVec(0,h1,0))); |
811 |
|
float scale = (h-orig).length(); |
812 |
|
DBG(dbg_horiztext2) << "Origin: "<<origin<<" "<<coords1.transform(origin)<<orig<<"\\n"; |
813 |
|
DBG(dbg_horiztext2) << "h: "<<h1<<" "<<h<<" "<<scale<<"\\n"; |
814 |
Vertexer<Coords> v(coords2, scale, orig.z); |
Vertexer<Coords> v(coords2, scale, orig.z); |
815 |
glPushAttrib(GL_ENABLE_BIT); |
glPushAttrib(GL_ENABLE_BIT); |
816 |
glEnable(GL_BLEND); |
glEnable(GL_BLEND); |