| 1 |
//#include <SDL/SDL.h>cxx . . $ `<file>/src/ShadowMap.cpp`/ |
| 2 |
|
| 3 |
typedef unsigned char Bytecxx . . $ Byte#; |
| 4 |
typedef unsigned int uintcxx . . $ uint#; |
| 5 |
|
| •6 |
#include <stdio.h> |
| 7 |
|
| 8 |
#include <GL/glew.h> |
| 9 |
#include "CgUtil.h"cxx . . $ `<file>/src/CgUtil.h`/ |
| 10 |
|
| 11 |
//#include <GL/gl.h> |
| 12 |
#include <math.h> |
| 13 |
//#include <GL/glu.h> |
| 14 |
|
| 15 |
#include <vector> |
| 16 |
|
| 17 |
#include <vcg/space/point3.h>cxx . . $ `<file>/vcg/vcg/space/point3.h`/ |
| 18 |
#include <vcg/space/color4.h>cxx . . $ `<file>/vcg/vcg/space/color4.h`/ |
| 19 |
|
| 20 |
|
| 21 |
using namespace vcg; |
| 22 |
using namespace std; |
| 23 |
|
| 24 |
#include "CubeMapSamp.h"cxx . . $ `<file>/src/CubeMapSamp.h`/ |
| 25 |
#include "OctaMapSamp.h"cxx . . $ `<file>/src/OctaMapSamp.h`/ |
| 26 |
|
| 27 |
#include "Mol.h"cxx . . $ `<file>/src/Mol.h`/ |
| 28 |
#include "HardSettings.h"cxx . . $ `<file>/src/HardSettings.h`/ |
| 29 |
#include "MyCanvas.h"cxx . . $ `<file>/src/MyCanvas.h`/ |
| 30 |
#include "ShadowMap.h"cxx . . $ `<file>/src/ShadowMap.h`/ |
| 31 |
|
| 32 |
bool use_accurate_halocxx . . $ use_accurate_halo.=true; |
| 33 |
|
| 34 |
|
| 35 |
bool validViewcxx . . $ validView(fb818b536fe750bb).(Point3fcxx . . $ vcg/Point3f# p){ |
| 36 |
if (!hardSettingscxx . . $ hardSettings..doubleSMcxx . . $ HardSettings#doubleSM.) return true; |
| 37 |
if (p[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0]>0) return true; |
| 38 |
if (p[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0]<0) return false; |
| 39 |
|
| 40 |
if (p[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1]<0) return true; |
| 41 |
if (p[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1]>0) return false; |
| 42 |
|
| 43 |
if (p[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]<0) return true; |
| 44 |
return false; |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
extern int CSIZEcxx . . $ CSIZE.; // size for alo patch |
| 49 |
extern int BSIZEcxx . . $ BSIZE.; // size for bonds patches |
| 50 |
|
| 51 |
//extern uint shadowFrame, shadowTexture, offsetFrame, haloFrame, haloTexture, finalFrame; |
| 52 |
//uint finalFrame=0; // frame dove metto l'immagine finale! 0 se lo schermo. |
| 53 |
|
| 54 |
CgUtilcxx . . $ CgUtil# shadowSettingscxx . . $ shadowSettings.; |
| 55 |
CgUtilcxx . . $ CgUtil# shadowSettingsAcccxx . . $ shadowSettingsAcc.; |
| 56 |
|
| 57 |
// functions defined later. |
| 58 |
static void setMatricescxx . . $ setMatrices(a34d4e3698320e04).(vcgcxx . . $ vcg/::Point3fcxx . . $ vcg/Point3f# L, int screensize, int screensizeHard, bool sx); |
| 59 |
static void restoreMatricescxx . . $ restoreMatrices(49f6e7a06ebc5aa8).(); |
| 60 |
|
| 61 |
static GLint lastviewportcxx . . $ lastviewport.[4]; |
| 62 |
|
| 63 |
|
| 64 |
float matSMcxx . . $ matSM.[4][4]; // matrix used during shadowmmap drawing |
| 65 |
float matFinalcxx . . $ matFinal.[4][4];// matrix for FP computation = matSM x (MV)^(-1) |
| 66 |
float HSratiocxx . . $ HSratio.; // ratio betweenhard and soft shadowbuffer |
| 67 |
|
| 68 |
extern Molcxx . . $ Mol# molcxx . . $ mol.; |
| 69 |
extern int winxcxx . . $ winx.,winycxx . . $ winy.; |
| 70 |
|
| 71 |
// FOR HALOS |
| 72 |
void prepareDepthTextureForCurrentViewpointcxx . . $ prepareDepthTextureForCurrentViewpoint(49f6e7a06ebc5aa8).(){ |
| 73 |
|
| 74 |
// Draw depth texture from current viewpoint |
| 75 |
|
| 76 |
haloCanvascxx . . $ haloCanvas..SetSameRescxx . . $ MyCanvas#SetSameRes(9f6d890b2e158c7a).( mainCanvascxx . . $ mainCanvas. ); |
| 77 |
haloCanvascxx . . $ haloCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 78 |
|
| 79 |
if (use_accurate_halocxx . . $ use_accurate_halo.) |
| 80 |
shadowSettingsAcccxx . . $ shadowSettingsAcc..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 81 |
else |
| 82 |
shadowSettingscxx . . $ shadowSettings..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 83 |
|
| 84 |
|
| 85 |
glClear( GL_DEPTH_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:352:9`! ) ; |
| 86 |
|
| 87 |
molcxx . . $ mol..Drawcxx . . $ Mol#Draw(49f6e7a06ebc5aa8).(); |
| 88 |
|
| 89 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 90 |
|
| 91 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 92 |
haloCanvascxx . . $ haloCanvas..SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 93 |
glEnable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 94 |
|
| 95 |
} |
| 96 |
|
| 97 |
Point3fcxx . . $ vcg/Point3f# lastLcxx . . $ lastL.(0,0,0); // last used light |
| 98 |
|
| 99 |
void ShadowMapcxx . . $ ShadowMap#::Updatecxx . . $ ShadowMap#Update(49f6e7a06ebc5aa8).(){ |
| 100 |
lastLcxx . . $ lastL..Zerocxx . . $ vcg/Point3#Zero(49f6e7a06ebc5aa8).(); |
| 101 |
} |
| 102 |
|
| 103 |
void ShadowMapcxx . . $ ShadowMap#::computeAsTexturecxx . . $ ShadowMap#computeAsTexture(7482869ca8a6e6e6).(vcgcxx . . $ vcg/::Point3fcxx . . $ vcg/Point3f# L, bool makeboth, MyCanvascxx . . $ MyCanvas# &canvas){ |
| 104 |
|
| 105 |
if (lastLcxx . . $ lastL.!=cxx . . $ vcg/Point3#`operator!=`(87cc7e3dc2d06c05).L) { |
| 106 |
|
| 107 |
canvas.SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 108 |
|
| 109 |
|
| 110 |
setMatricescxx . . $ setMatrices(a34d4e3698320e04).(Lcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4)., canvas.GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(),canvas.GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).(), true); |
| 111 |
glClearDepth(1); |
| 112 |
glClear( GL_DEPTH_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:352:9`! ); |
| 113 |
glDisable(GL_SCISSOR_TESTcxx . . $ `<external>/18396878532286971346/glew.h:19036:9`!); |
| 114 |
glDepthFunc(GL_LESScxx . . $ `<external>/18396878532286971346/glew.h:360:9`!); |
| 115 |
|
| 116 |
mcxx . . $ ShadowMap#m..DrawShadowmapcxx . . $ Mol#DrawShadowmap(b45ddcbc8423892c).(false); |
| 117 |
restoreMatricescxx . . $ restoreMatrices(49f6e7a06ebc5aa8).(); |
| 118 |
|
| 119 |
|
| 120 |
if (hardSettingscxx . . $ hardSettings..doubleSMcxx . . $ HardSettings#doubleSM. && makeboth) { |
| 121 |
setMatricescxx . . $ setMatrices(a34d4e3698320e04).(Lcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4)., canvas.GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(), canvas.GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).(), false); |
| 122 |
glClearDepth(-10000); |
| 123 |
glClear( GL_DEPTH_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:352:9`!); |
| 124 |
glDepthFunc(GL_GREATERcxx . . $ `<external>/18396878532286971346/glew.h:363:9`!); |
| 125 |
|
| 126 |
glDisable(GL_SCISSOR_TESTcxx . . $ `<external>/18396878532286971346/glew.h:19036:9`!); |
| 127 |
|
| 128 |
mcxx . . $ ShadowMap#m..DrawShadowmapcxx . . $ Mol#DrawShadowmap(b45ddcbc8423892c).(false); |
| 129 |
|
| 130 |
restoreMatricescxx . . $ restoreMatrices(49f6e7a06ebc5aa8).(); |
| 131 |
} |
| 132 |
|
| 133 |
glClearDepth(1); |
| 134 |
glDepthFunc(GL_LESScxx . . $ `<external>/18396878532286971346/glew.h:360:9`!); |
| 135 |
|
| 136 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 137 |
|
| 138 |
lastLcxx . . $ lastL.=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).L; |
| 139 |
} |
| 140 |
|
| 141 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 142 |
|
| 143 |
canvas.SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 144 |
|
| 145 |
} |
| 146 |
|
| 147 |
|
| 148 |
extern ShadowMapcxx . . $ ShadowMap# shadowmapcxx . . $ shadowmap.; |
| 149 |
float extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(float x[4][4]); |
| 150 |
float extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(9b8c9e39889c762c).(); |
| 151 |
//float shadowScaleFactor=1; |
| 152 |
|
| 153 |
|
| 154 |
void ShadowMapcxx . . $ ShadowMap#::FeedParameterscxx . . $ ShadowMap#FeedParameters(49f6e7a06ebc5aa8).(){ |
| 155 |
for (int i=0; i<3; i++) { |
| 156 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, i+3, |
| 157 |
matFinalcxx . . $ matFinal.[0][i],matFinalcxx . . $ matFinal.[1][i],matFinalcxx . . $ matFinal.[2][i],matFinalcxx . . $ matFinal.[3][i] |
| 158 |
); |
| 159 |
} |
| 160 |
} |
| 161 |
|
| 162 |
extern CgUtilcxx . . $ CgUtil# cgSettingscxx . . $ cgSettings.; |
| 163 |
|
| 164 |
/*void DrawTmp(){ |
| 165 |
|
| 166 |
cgSettings.BindShaders(); |
| 167 |
|
| 168 |
glEnable(GL_TEXTURE_2D); |
| 169 |
//glBindTexture(GL_TEXTURE_2D, molTexture); |
| 170 |
|
| 171 |
glActiveTextureARB(GL_TEXTURE1_ARB); |
| 172 |
glBindTexture(GL_TEXTURE_2D, shadowTexture); |
| 173 |
|
| 174 |
shadowmap.m.Draw(); |
| 175 |
// shadowmap.m.DrawShadowmap(false); |
| 176 |
|
| 177 |
|
| 178 |
glDisable(GL_VERTEX_PROGRAM_ARB); |
| 179 |
glDisable(GL_FRAGMENT_PROGRAM_ARB); |
| 180 |
glDisable(GL_BLEND); |
| 181 |
|
| 182 |
|
| •183 |
glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_2D); |
| 184 |
glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); |
| 185 |
glBindTexture(GL_TEXTURE_2D, shadowTexture);*/ |
| 186 |
// glBindTexture(GL_TEXTURE_2D, shadowTexture); |
| 187 |
|
| 188 |
/* glBegin(GL_QUADS); |
| 189 |
glColor3f(0,0,1); |
| 190 |
float h=-0.25, k=-0.25; |
| 191 |
glTexCoord2f(0,0); glVertex3d( k, h,0.1); |
| 192 |
glTexCoord2f(1,0); glVertex3d( k,+1,0.1); |
| 193 |
glTexCoord2f(1,1); glVertex3d(+1,+1,0.1); |
| 194 |
glTexCoord2f(0,1); glVertex3d(+1, h,0.1); |
| 195 |
glEnd(); |
| 196 |
|
| 197 |
glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); |
| 198 |
glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); |
| 199 |
|
| 200 |
glBegin(GL_QUADS); |
| 201 |
glColor3f(1,1,1); |
| 202 |
glTexCoord2f(0,0); glVertex3d(k-0.75,h-0.75,0); |
| 203 |
glTexCoord2f(1,0); glVertex3d(k-0.75,0.25,0); |
| 204 |
glTexCoord2f(1,1); glVertex3d(0.25,0.25,0); |
| 205 |
glTexCoord2f(0,1); glVertex3d(0.25,h-0.75,0); |
| 206 |
glEnd(); |
| 207 |
*/ |
| 208 |
/*glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); |
| 209 |
glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); */ |
| 210 |
/*}*/ |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
bool ShadowMapcxx . . $ ShadowMap#::initcxx . . $ ShadowMap#init(c9857a73d68e59ba).(){ |
| 215 |
shadowSettingscxx . . $ shadowSettings..SetForShadowMapcxx . . $ CgUtil#SetForShadowMap(b45ddcbc8423892c).(false); |
| 216 |
shadowSettingsAcccxx . . $ shadowSettingsAcc..SetForShadowMapcxx . . $ CgUtil#SetForShadowMap(b45ddcbc8423892c).(true); |
| 217 |
|
| 218 |
mainCanvascxx . . $ mainCanvas..RedirectToVideocxx . . $ MyCanvas#RedirectToVideo(49f6e7a06ebc5aa8).(); |
| 219 |
mainCanvascxx . . $ mainCanvas..SetVideoSizecxx . . $ MyCanvas#SetVideoSize(d4f767463ce0a6b3).(winxcxx . . $ winx.); |
| 220 |
|
| 221 |
|
| 222 |
// test shadow and shadowAO canvases |
| 223 |
shadowmapCanvascxx . . $ shadowmapCanvas..SetRescxx . . $ MyCanvas#SetRes(d4f767463ce0a6b3).(hardSettingscxx . . $ hardSettings..SHADOWMAP_SIZEcxx . . $ HardSettings#SHADOWMAP_SIZE.); |
| 224 |
shadowmapCanvascxx . . $ shadowmapCanvas..ratio2x1cxx . . $ MyCanvas#ratio2x1.=(hardSettingscxx . . $ hardSettings..doubleSMcxx . . $ HardSettings#doubleSM.==1); |
| 225 |
if (!shadowmapCanvascxx . . $ shadowmapCanvas..Testcxx . . $ MyCanvas#Test(c9857a73d68e59ba).() ) return false; |
| 226 |
|
| 227 |
shadowAOCanvascxx . . $ shadowAOCanvas..SetRescxx . . $ MyCanvas#SetRes(d4f767463ce0a6b3).(hardSettingscxx . . $ hardSettings..AOSM_SIZEcxx . . $ HardSettings#AOSM_SIZE.); |
| 228 |
shadowAOCanvascxx . . $ shadowAOCanvas..ratio2x1cxx . . $ MyCanvas#ratio2x1.=(hardSettingscxx . . $ hardSettings..doubleSMcxx . . $ HardSettings#doubleSM.==1); |
| 229 |
//shadowAOCanvas.ratio2x1=(hardSettings.doubleSM==1); |
| 230 |
if (!shadowAOCanvascxx . . $ shadowAOCanvas..Testcxx . . $ MyCanvas#Test(c9857a73d68e59ba).() ) return false; |
| 231 |
|
| 232 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 233 |
return true; |
| 234 |
} |
| 235 |
|
| 236 |
bool ShadowMapcxx . . $ ShadowMap#::initHalocxx . . $ ShadowMap#initHalo(c9857a73d68e59ba).(){ |
| 237 |
|
| 238 |
// test halo canvases |
| 239 |
haloCanvascxx . . $ haloCanvas..SetSameRescxx . . $ MyCanvas#SetSameRes(9f6d890b2e158c7a).(mainCanvascxx . . $ mainCanvas.); |
| 240 |
if (!haloCanvascxx . . $ haloCanvas..Testcxx . . $ MyCanvas#Test(c9857a73d68e59ba).() ) return false; |
| 241 |
|
| 242 |
|
| 243 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 244 |
return true; |
| 245 |
} |
| 246 |
|
| 247 |
|
| 248 |
bool AOgpu2cxx . . $ AOgpu2#::initcxx . . $ AOgpu2#init(c9857a73d68e59ba).(){ |
| 249 |
if (!moltextureCanvascxx . . $ moltextureCanvas..Testcxx . . $ MyCanvas#Test(c9857a73d68e59ba).()) return false; |
| 250 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| •251 |
return true; |
| 252 |
} |
| 253 |
|
| 254 |
float myrandcxx . . $ myrand(9b8c9e39889c762c).(); |
| 255 |
|
| 256 |
static CgUtilcxx . . $ CgUtil# aogpu_settingscxx . . $ aogpu_settings.; |
| 257 |
static CgUtilcxx . . $ CgUtil# aogpustick_settingscxx . . $ aogpustick_settings.; |
| 258 |
|
| 259 |
void AOgpu2cxx . . $ AOgpu2#::Resetcxx . . $ AOgpu2#Reset(3446b187c880527c).(Molcxx . . $ Mol# &m){ |
| 260 |
moltextureCanvascxx . . $ moltextureCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 261 |
|
| 262 |
glClearColor(0,0,0,1); |
| 263 |
glClear( GL_COLOR_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:765:9`!); |
| 264 |
} |
| 265 |
|
| 266 |
void AOgpu2cxx . . $ AOgpu2#::Bindcxx . . $ AOgpu2#Bind(49f6e7a06ebc5aa8).(){ |
| 267 |
moltextureCanvascxx . . $ moltextureCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 268 |
} |
| 269 |
|
| 270 |
AOgpu2cxx . . $ AOgpu2#::AOgpu2cxx . . $ AOgpu2#AOgpu2(6a1303b020515adf).( Point3fcxx . . $ vcg/Point3f# dir, Molcxx . . $ Mol# &m, int ndir){ |
| 271 |
|
| 272 |
shadowmapcxx . . $ shadowmap..computeAsTexturecxx . . $ ShadowMap#computeAsTexture(7482869ca8a6e6e6).(dircxx . . $ vcg/Point3#Point3(5401f57a7bce03f4)., true, shadowAOCanvascxx . . $ shadowAOCanvas. ); |
| 273 |
glFinish(); |
| 274 |
|
| 275 |
moltextureCanvascxx . . $ moltextureCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 276 |
|
| 277 |
glDisable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 278 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 279 |
|
| 280 |
|
| 281 |
aogpu_settingscxx . . $ aogpu_settings..BindDrawAOShadercxx . . $ CgUtil#BindDrawAOShader(c9857a73d68e59ba).(); |
| 282 |
for (int i=0; i<3; i++) { |
| 283 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, i, |
| 284 |
matSMcxx . . $ matSM.[0][i],matSMcxx . . $ matSM.[1][i],matSMcxx . . $ matSM.[2][i],matSMcxx . . $ matSM.[3][i] |
| 285 |
); |
| 286 |
//printf("Sending %d (%f %f %f %f)\n", i, mat[0][i],mat[1][i],mat[2][i],mat[3][i]); |
| 287 |
} |
| 288 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, 3, dir[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],dir[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],dir[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 4.0/ndir ); |
| 289 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, 4, |
| 290 |
0,stick_radiuscxx . . $ stick_radius.,0,0 |
| 291 |
); |
| 292 |
|
| 293 |
m.DrawOnTexturecxx . . $ Mol#DrawOnTexture(49f6e7a06ebc5aa8).(); |
| 294 |
|
| 295 |
glDisable(GL_BLENDcxx . . $ `<external>/18396878532286971346/glew.h:496:9`!); |
| 296 |
|
| 297 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 298 |
|
| 299 |
}; |
| 300 |
|
| 301 |
void AOgpu2cxx . . $ AOgpu2#::UnBindcxx . . $ AOgpu2#UnBind(49f6e7a06ebc5aa8).(){ |
| 302 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 303 |
}; |
| 304 |
|
| 305 |
float myrandcxx . . $ myrand(9b8c9e39889c762c).(){ |
| 306 |
static int k=0; |
| 307 |
k+=1231543214; |
| 308 |
return ((k%12421)/12421.0); |
| 309 |
} |
| 310 |
|
| 311 |
void Bondcxx . . $ Bond#::DrawOnTexturecxx . . $ Bond#DrawOnTexture(49f6e7a06ebc5aa8).(){ |
| 312 |
//glColor3f(myrand(),myrand(),myrand()); |
| 313 |
float h=0.0; |
| 314 |
|
| 315 |
float Xm=(-1.0)-1.0/BSIZEcxx . . $ BSIZE.; |
| 316 |
float Xp=+1.0+1.0/BSIZEcxx . . $ BSIZE.; |
| 317 |
float Ym=Xm, |
| 318 |
Yp=+1.0+1.0/CSIZEcxx . . $ CSIZE./1.0; |
| 319 |
Point3fcxx . . $ vcg/Point3f# tmp=startpcxx . . $ Bond#startp.^cxx . . $ vcg/Point3#`operator^`(df3b8fd47e21bd0c).dircxx . . $ Bond#dir.; |
| 320 |
startpcxx . . $ Bond#startp..Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 321 |
tmp.Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 322 |
glMultiTexCoord3fARBcxx . . $ `<external>/18396878532286971346/glew.h:5837:9`!(GL_TEXTURE2_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5748:9`!, startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 323 |
glMultiTexCoord3fARBcxx . . $ `<external>/18396878532286971346/glew.h:5837:9`!(GL_TEXTURE3_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5749:9`!, tmp[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],tmp[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],tmp[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 324 |
|
| 325 |
glMultiTexCoord3fARBcxx . . $ `<external>/18396878532286971346/glew.h:5837:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!, bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 326 |
glTexCoord2f(Xm,Yp); glVertex2f(-h+txcxx . . $ Bond#tx., -h+tycxx . . $ Bond#ty.+CSIZEcxx . . $ CSIZE.); |
| 327 |
glTexCoord2f(Xm,Ym); glVertex2f(-h+txcxx . . $ Bond#tx., -h+tycxx . . $ Bond#ty.); |
| 328 |
glMultiTexCoord3fARBcxx . . $ `<external>/18396878532286971346/glew.h:5837:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!, acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 329 |
glTexCoord2f(Xp,Ym); glVertex2f(-h+txcxx . . $ Bond#tx.+BSIZEcxx . . $ BSIZE.,-h+tycxx . . $ Bond#ty.); |
| 330 |
glTexCoord2f(Xp,Yp); glVertex2f(-h+txcxx . . $ Bond#tx.+BSIZEcxx . . $ BSIZE.,-h+tycxx . . $ Bond#ty.+CSIZEcxx . . $ CSIZE.); |
| 331 |
} |
| 332 |
|
| 333 |
void QAtomcxx . . $ QAtom#::DrawOnTexturecxx . . $ QAtom#DrawOnTexture(49f6e7a06ebc5aa8).(){ |
| 334 |
glColor3f(myrandcxx . . $ myrand(9b8c9e39889c762c).(),myrandcxx . . $ myrand(9b8c9e39889c762c).(),myrandcxx . . $ myrand(9b8c9e39889c762c).()); |
| 335 |
float h=0.0; |
| 336 |
|
| 337 |
float Xm=(-1.0)-1.0/CSIZEcxx . . $ CSIZE./1.0; |
| 338 |
float Xp=+1.0+1.0/CSIZEcxx . . $ CSIZE./1.0; |
| 339 |
float Ym=Xm, Yp=Xp; |
| 340 |
glMultiTexCoord4fARBcxx . . $ `<external>/18396878532286971346/glew.h:5845:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!, pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.,rcxx . . $ QAtom#r. ); |
| 341 |
glTexCoord2f(Xm,Ym); glVertex2f(-h+txcxx . . $ QAtom#tx., -h+tycxx . . $ QAtom#ty.); |
| 342 |
glTexCoord2f(Xp,Ym); glVertex2f(-h+txcxx . . $ QAtom#tx.+CSIZEcxx . . $ CSIZE.,-h+tycxx . . $ QAtom#ty.); |
| 343 |
glTexCoord2f(Xp,Yp); glVertex2f(-h+txcxx . . $ QAtom#tx.+CSIZEcxx . . $ CSIZE.,-h+tycxx . . $ QAtom#ty.+CSIZEcxx . . $ CSIZE.); |
| 344 |
glTexCoord2f(Xm,Yp); glVertex2f(-h+txcxx . . $ QAtom#tx., -h+tycxx . . $ QAtom#ty.+CSIZEcxx . . $ CSIZE.); |
| 345 |
} |
| 346 |
|
| 347 |
void Molcxx . . $ Mol#::DrawOnTexturecxx . . $ Mol#DrawOnTexture(49f6e7a06ebc5aa8).(){ |
| 348 |
|
| 349 |
|
| 350 |
glEnable(GL_BLENDcxx . . $ `<external>/18396878532286971346/glew.h:496:9`!); |
| 351 |
glBlendFunc(GL_ONEcxx . . $ `<external>/18396878532286971346/glew.h:333:9`!, GL_ONEcxx . . $ `<external>/18396878532286971346/glew.h:333:9`! ); |
| 352 |
|
| 353 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 354 |
glPushMatrix(); |
| 355 |
glLoadIdentity(); |
| 356 |
glOrtho(0,moltextureCanvascxx . . $ moltextureCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(),0,moltextureCanvascxx . . $ moltextureCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(), 0,1); |
| 357 |
|
| 358 |
|
| 359 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 360 |
glPushMatrix(); |
| 361 |
glLoadIdentity(); |
| 362 |
|
| 363 |
|
| 364 |
glGetIntegerv(GL_VIEWPORTcxx . . $ `<external>/18396878532286971346/glew.h:19034:9`!, lastviewportcxx . . $ lastviewport.); |
| 365 |
glViewport(0,0,moltextureCanvascxx . . $ moltextureCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(),moltextureCanvascxx . . $ moltextureCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).()); |
| 366 |
|
| 367 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 368 |
glDisable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 369 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE0_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5746:9`!); |
| 370 |
glDisable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 371 |
|
| 372 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •373 |
for (int i=0; i < (int)atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) |
| 374 |
atomcxx . . $ Mol#atom.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].DrawOnTexturecxx . . $ QAtom#DrawOnTexture(49f6e7a06ebc5aa8).(); |
| 375 |
glEnd(); |
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
if (stickscxx . . $ Mol#sticks.) { |
| 382 |
aogpustick_settingscxx . . $ aogpustick_settings..BindDrawAOShaderStickscxx . . $ CgUtil#BindDrawAOShaderSticks(c9857a73d68e59ba).(); |
| 383 |
//glDisable(GL_BLEND); |
| 384 |
//glDisable(GL_FRAGMENT_PROGRAM_ARB); |
| 385 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •386 |
for (int i=0; i < (int)bondcxx . . $ Mol#bond..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) bondcxx . . $ Mol#bond.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].DrawOnTexturecxx . . $ Bond#DrawOnTexture(49f6e7a06ebc5aa8).(); |
| 387 |
glEnd(); |
| 388 |
//glEnable(GL_FRAGMENT_PROGRAM_ARB); |
| 389 |
} |
| 390 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 391 |
glPopMatrix(); |
| 392 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 393 |
glPopMatrix(); |
| 394 |
glViewport(lastviewportcxx . . $ lastviewport.[0],lastviewportcxx . . $ lastviewport.[1],lastviewportcxx . . $ lastviewport.[2],lastviewportcxx . . $ lastviewport.[3]); |
| 395 |
}; |
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
static void restoreMatricescxx . . $ restoreMatrices(49f6e7a06ebc5aa8).(){ |
| 404 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 405 |
glPopMatrix(); |
| 406 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 407 |
glPopMatrix(); |
| 408 |
glViewport(lastviewportcxx . . $ lastviewport.[0],lastviewportcxx . . $ lastviewport.[1],lastviewportcxx . . $ lastviewport.[2],lastviewportcxx . . $ lastviewport.[3]); |
| 409 |
} |
| 410 |
|
| 411 |
static void setMatricescxx . . $ setMatrices(a34d4e3698320e04).(vcgcxx . . $ vcg/::Point3fcxx . . $ vcg/Point3f# L, int screensize, int screensizeHard, bool sx){ |
| 412 |
// orthonormal basis |
| 413 |
L.Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 414 |
Point3fcxx . . $ vcg/Point3f# axcxx . . $ vcg/Point3#Point3(49f6e7a06ebc5aa8).,aycxx . . $ vcg/Point3#Point3(49f6e7a06ebc5aa8).,az=Lcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).; |
| 415 |
ax=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).az^cxx . . $ vcg/Point3#`operator^`(df3b8fd47e21bd0c).Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(1,0,0); |
| 416 |
if (ax.SquaredNormcxx . . $ vcg/Point3#SquaredNorm(8f5363d873dd4781).()<0.1) ax=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).az^cxx . . $ vcg/Point3#`operator^`(df3b8fd47e21bd0c).Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(0,1,0); |
| 417 |
ax=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).ax.Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 418 |
ay=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).(az^cxx . . $ vcg/Point3#`operator^`(df3b8fd47e21bd0c).ax).Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 419 |
|
| 420 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 421 |
glPushMatrix(); |
| 422 |
glLoadIdentity(); |
| 423 |
/* if (!sx) { |
| 424 |
glScalef(1,1,-1); |
| 425 |
}*/ |
| 426 |
|
| 427 |
|
| 428 |
GLfloat nearPlane = 1.0; |
| 429 |
GLfloat farPlane = 201; |
| 430 |
glOrtho(-1,+1,-1,+1, nearPlane, farPlane); |
| 431 |
|
| 432 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 433 |
|
| 434 |
// PREPARE MATRIX for shadow test... |
| 435 |
|
| 436 |
glPushMatrix(); |
| 437 |
glLoadIdentity(); |
| 438 |
glOrtho(-1,+1,-1,+1, nearPlane, farPlane); |
| 439 |
|
| 440 |
gluLookAt(0,0,-4, 0,0,0, 0,1,0); |
| 441 |
gluLookAt( az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 0,0,0, ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0], ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1], ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 442 |
|
| 443 |
float r=shadowmapcxx . . $ shadowmap..mcxx . . $ ShadowMap#m..rcxx . . $ Mol#r.; |
| 444 |
float px=shadowmapcxx . . $ shadowmap..mcxx . . $ ShadowMap#m..pxcxx . . $ Mol#px.; |
| 445 |
float py=shadowmapcxx . . $ shadowmap..mcxx . . $ ShadowMap#m..pycxx . . $ Mol#py.; |
| 446 |
float pz=shadowmapcxx . . $ shadowmap..mcxx . . $ ShadowMap#m..pzcxx . . $ Mol#pz.; |
| 447 |
glScalef(1/r,1/r,1/r); |
| 448 |
glTranslatef(-px,-py,-pz); |
| 449 |
|
| 450 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(matSMcxx . . $ matSM.[0][0])); |
| 451 |
|
| 452 |
// ...done! |
| 453 |
|
| 454 |
glLoadIdentity(); |
| 455 |
gluLookAt(0,0,-4, 0,0,0, 0,1,0); |
| 456 |
gluLookAt( az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],az[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 0,0,0, ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0], ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1], ay[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 457 |
|
| 458 |
//shadowScaleFactor=extractCurrentScaleFactor()/r; |
| 459 |
|
| 460 |
glGetIntegerv(GL_VIEWPORTcxx . . $ `<external>/18396878532286971346/glew.h:19034:9`!, lastviewportcxx . . $ lastviewport.); |
| 461 |
|
| 462 |
if (sx) { |
| 463 |
glViewport(0,0,screensize,screensize); |
| 464 |
glEnable(GL_SCISSOR_TESTcxx . . $ `<external>/18396878532286971346/glew.h:19036:9`!); |
| 465 |
glScissor(0,0,screensize,screensize); |
| 466 |
} |
| 467 |
else { |
| 468 |
glViewport(screensize,0,screensize,screensize); |
| 469 |
glEnable(GL_SCISSOR_TESTcxx . . $ `<external>/18396878532286971346/glew.h:19036:9`!); |
| 470 |
glScissor(screensize,0,screensize,screensize); |
| 471 |
} |
| 472 |
|
| 473 |
HSratiocxx . . $ HSratio. = float(screensize) / float(screensizeHard) ; |
| 474 |
//for (int i=0; i<4; i++) |
| 475 |
//for (int j=0; j<2; j++) matSM[i][j] /=ratio; |
| 476 |
|
| 477 |
} |
| 478 |
|
| 479 |
|
| 480 |
// quick and dirty |
| 481 |
#include <vcg/math/matrix44.h>cxx . . $ `<file>/vcg/vcg/math/matrix44.h`/ |
| 482 |
void ShadowMapcxx . . $ ShadowMap#::GetCurrentPVMatrixcxx . . $ ShadowMap#GetCurrentPVMatrix(49f6e7a06ebc5aa8).(){ |
| 483 |
|
| 484 |
float matP[16]; |
| 485 |
float matMV[16]; |
| 486 |
|
| 487 |
glGetFloatv(GL_PROJECTION_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:486:9`!, matP); |
| 488 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, matMV); |
| 489 |
|
| 490 |
Matrix44fcxx . . $ vcg/Matrix44f# Acxx . . $ vcg/Matrix44#Matrix44(88376428bb603c08).(matSMcxx . . $ matSM.[0]); |
| 491 |
Matrix44fcxx . . $ vcg/Matrix44f# Bcxx . . $ vcg/Matrix44#Matrix44(88376428bb603c08).(matMV); |
| 492 |
Matrix44fcxx . . $ vcg/Matrix44f# Ccxx . . $ vcg/Matrix44#Matrix44(88376428bb603c08).(matP); |
| 493 |
|
| 494 |
A=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Transposecxx . . $ vcg/Transpose(24a89560d95dde74).( A ); |
| 495 |
B=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Transposecxx . . $ vcg/Transpose(24a89560d95dde74).( B ); |
| 496 |
C=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Transposecxx . . $ vcg/Transpose(24a89560d95dde74).( C ); |
| 497 |
|
| 498 |
Matrix44fcxx . . $ vcg/Matrix44f# P = C*cxx . . $ vcg/Matrix44#`operator*`(a7e7cbbbdf7f5ddb).B; |
| 499 |
P=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Invertcxx . . $ vcg/Invert(24a89560d95dde74).( P ); |
| 500 |
Matrix44fcxx . . $ vcg/Matrix44f# res = A*cxx . . $ vcg/Matrix44#`operator*`(a7e7cbbbdf7f5ddb).P; |
| 501 |
|
| 502 |
Matrix44fcxx . . $ vcg/Matrix44f# mulcxx . . $ vcg/Matrix44#Matrix44(49f6e7a06ebc5aa8).; |
| 503 |
Matrix44fcxx . . $ vcg/Matrix44f# addcxx . . $ vcg/Matrix44#Matrix44(49f6e7a06ebc5aa8).; |
| 504 |
|
| 505 |
GLint vp[4]; |
| 506 |
glGetIntegerv(GL_VIEWPORTcxx . . $ `<external>/18396878532286971346/glew.h:19034:9`!, vp); |
| 507 |
|
| 508 |
mul.SetScalecxx . . $ vcg/Matrix44#SetScale(a0acecf2c1b3a34e).(Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(2.0f/vp[2], 2.0f/vp[3], 2)); |
| 509 |
add.SetTranslatecxx . . $ vcg/Matrix44#SetTranslate(a0acecf2c1b3a34e).(Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(-1,-1,-1)); |
| 510 |
|
| 511 |
//Matrix44f mulHS; |
| 512 |
//mulHS.SetScale(Point3f(HSratio,HSratio,1) ); |
| 513 |
|
| 514 |
res=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).res*cxx . . $ vcg/Matrix44#`operator*`(a7e7cbbbdf7f5ddb).add*cxx . . $ vcg/Matrix44#`operator*`(a7e7cbbbdf7f5ddb).mul; |
| 515 |
|
| 516 |
for (int i=0; i<4; i++) |
| 517 |
for (int j=0; j<4; j++) |
| 518 |
matFinalcxx . . $ matFinal.[i][j]=res[cxx . . $ vcg/Matrix44#`operator[]`(72482124cd0e1400).j][i]; |
| 519 |
} |
| 520 |
/* |
| 521 |
void ShadowMap::GetCurrentPVMatrix(){ |
| 522 |
|
| 523 |
computeAxBm1xCm1( &(res[0][0]) , &(A[0][0]) , &(B[0][0]) , &(C[0][0])); |
| 524 |
}*/ |
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
void testcxx . . $ test(49f6e7a06ebc5aa8).(){ |
| 529 |
|
| 530 |
return; |
| 531 |
float nf[2]; |
| 532 |
glGetFloatv(GL_DEPTH_RANGEcxx . . $ `<external>/18396878532286971346/glew.h:19033:9`!, nf); |
| 533 |
FILE *f=fopen("test.txt","w"); |
| 534 |
fprintf(f,"near=%f,far=%f\n\n",nf[0],nf[1]); |
| 535 |
fclose(f); |
| 536 |
|
| 537 |
float mat[16]; |
| 538 |
float matP[16]; |
| 539 |
|
| 540 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, mat); |
| 541 |
glGetFloatv(GL_PROJECTION_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:486:9`!, matP); |
| 542 |
|
| 543 |
|
| 544 |
Matrix44fcxx . . $ vcg/Matrix44f# Acxx . . $ vcg/Matrix44#Matrix44(88376428bb603c08).(mat); |
| 545 |
A=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Transposecxx . . $ vcg/Transpose(24a89560d95dde74).( A ); |
| 546 |
|
| 547 |
Matrix44fcxx . . $ vcg/Matrix44f# Bcxx . . $ vcg/Matrix44#Matrix44(88376428bb603c08).(matP); |
| 548 |
B=cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0).vcgcxx . . $ vcg/::Transposecxx . . $ vcg/Transpose(24a89560d95dde74).( B ); |
| 549 |
|
| 550 |
A =cxx . . $ vcg/Matrix44#`operator=`(b0f4ccd8175ed3a0). B*cxx . . $ vcg/Matrix44#`operator*`(a7e7cbbbdf7f5ddb).A; |
| 551 |
|
| 552 |
for (int i=0; i<4; i++) |
| 553 |
for (int j=0; j<4; j++) |
| 554 |
mat[i*4+j]=A[cxx . . $ vcg/Matrix44#`operator[]`(72482124cd0e1400).j][i]; |
| 555 |
|
| 556 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 557 |
glLoadIdentity( ); |
| 558 |
|
| 559 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 560 |
glLoadMatrixf( mat ); |
| 561 |
|
| 562 |
|
| 563 |
} |