/[gzz]/gzz/gfx/librenderables/renderables.py
ViewVC logotype

Diff of /gzz/gfx/librenderables/renderables.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.84 by benja, Sun Sep 29 16:21:11 2002 UTC revision 1.85 by tjl, Mon Sep 30 08:15:42 2002 UTC
# Line 327  rs = [ Line 327  rs = [
327  {  {
328      "Type" : "2",      "Type" : "2",
329      "Name": "PaperQuad",      "Name": "PaperQuad",
330      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;",      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float dicefactor;",
331      "Params" : """      "Params" : """
332              Paper paper, float x0, float y0, float x1, float y1,              Paper paper, float x0, float y0, float x1, float y1,
333              float scale              float scale, float dicefactor
334          """,          """,
335      "ParamCode" : """      "ParamCode" : """
336              this->paper = paper;              this->paper = paper;
# Line 339  rs = [ Line 339  rs = [
339              this->x1 = x1;              this->x1 = x1;
340              this->y1 = y1;              this->y1 = y1;
341              this->scale = scale;              this->scale = scale;
342                this->dicefactor = dicefactor;
343          """,          """,
344      "RenderCode" : """      "RenderCode" : """
345              Coords &coords2inv = *coords2.getInverse();              Coords &coords2inv = *coords2.getInverse();
# Line 380  rs = [ Line 381  rs = [
381              double len = hypot(x1-x0, y1-y0);              double len = hypot(x1-x0, y1-y0);
382              double nonl = coords1.nonlinearity(ctr, len);              double nonl = coords1.nonlinearity(ctr, len);
383                            
384              int dice = (int)(len * nonl) + 2;              int dice = (int)(len * nonl * dicefactor) + 2;
385              DBG(dbg) << "Dice: " << dice <<"\\n";              DBG(dbg) << "Dice: " << dice <<"\\n";
386    
387              float vertices[dice][dice][5];              float vertices[dice][dice][5];
# Line 564  rs = [ Line 565  rs = [
565  {  {
566      "Type" : "2",      "Type" : "2",
567      "Name": "IrregularQuad",      "Name": "IrregularQuad",
568      "Data": "float x0, y0, x1, y1; float border; float freq; int mode; CallGLCode setup;",      "Data": """float x0, y0, x1, y1; float border; float freq; int mode; CallGLCode setup;
569                    float dicefactor;""",
570      "Params" : """      "Params" : """
571              float x0, float y0, float x1, float y1,              float x0, float y0, float x1, float y1,
572              float border, float ripple_period, int mode, String setupcode              float border, float ripple_period, int mode, String setupcode,
573                float dicefactor
574          """,          """,
575      "ParamCode" : """      "ParamCode" : """
576              this->x0 = x0;              this->x0 = x0;
# Line 578  rs = [ Line 581  rs = [
581              this->freq = 1.0 / ripple_period;              this->freq = 1.0 / ripple_period;
582              this->mode = mode;              this->mode = mode;
583              setup = CallGLCode(string(setupcode.begin(), setupcode.end()).c_str());              setup = CallGLCode(string(setupcode.begin(), setupcode.end()).c_str());
584                this->dicefactor = dicefactor;
585          """,          """,
586      "ExtraClass" : """      "ExtraClass" : """
587              template <class Coords>              template <class Coords>
# Line 674  rs = [ Line 678  rs = [
678    
679          ZPt ctr = coords2.transform(ZPt(0,0,0));          ZPt ctr = coords2.transform(ZPt(0,0,0));
680          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();          double radius = (coords2.transform(ZPt(1,1,0)) - ZPt(0,0,0)).length();
681          double nonl = coords1.nonlinearity(ctr, radius);          double nonl = dicefactor * coords1.nonlinearity(ctr, radius);
682    
683          int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;          int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;
684          int dicex = (int)fabs(2 * border * (1 / bx - 2) * nonl) + 1;          int dicex = (int)fabs(2 * border * (1 / bx - 2) * nonl) + 1;

Legend:
Removed from v.1.84  
changed lines
  Added in v.1.85

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26