Rev 73 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 73 | Rev 84 | ||
---|---|---|---|
Line 126... | Line 126... | ||
126 | 126 | ||
127 | Init(); |
127 | Init(); |
128 | 128 | ||
129 | double cx = 0.0; |
129 | double cx = 0.0; |
130 | TVector3 vodnik_edge[4]; |
130 | TVector3 vodnik_edge[4]; |
131 | double t = |
131 | double t = 4.0; |
132 | vodnik_edge[0].SetXYZ(cx, t,-t); |
132 | vodnik_edge[0].SetXYZ(cx, t,-t); |
133 | vodnik_edge[1].SetXYZ(cx, t, t); |
133 | vodnik_edge[1].SetXYZ(cx, t, t); |
134 | vodnik_edge[2].SetXYZ(cx,-t, t); |
134 | vodnik_edge[2].SetXYZ(cx,-t, t); |
135 | vodnik_edge[3].SetXYZ(cx,-t,-t); |
135 | vodnik_edge[3].SetXYZ(cx,-t,-t); |
136 | 136 | ||
- | 137 | CSurface surf; |
|
137 |
|
138 | //surf = CSurface(p_type, vodnik_edge, p_n1, p_n2, 0.96); |
- | 139 | surf.Set(p_type, vodnik_edge, p_n1, p_n2, 0.96); |
|
138 | surf |
140 | surf.FlipN(); |
139 | surf |
141 | surf.SetFresnel(1); |
140 | surf |
142 | surf.Draw(); |
141 | 143 | ||
142 | CRay *ray = new CRay(cx, 0.0, 0.0, TMath::Cos(theta), 0.0, TMath::Sin(theta)); |
144 | CRay *ray = new CRay(cx, 0.0, 0.0, TMath::Cos(theta), 0.0, TMath::Sin(theta)); |
143 | ray->SetColor(kRed); |
145 | ray->SetColor(kRed); |
144 | //p_pol = rotatey(p_pol0, -theta); |
146 | //p_pol = rotatey(p_pol0, -theta); |
145 | TVector3 sE(0,1,0); |
147 | TVector3 sE(0,1,0); |
Line 149... | Line 151... | ||
149 | //printf("p_pol = "); printv(p_pol); |
151 | //printf("p_pol = "); printv(p_pol); |
150 | ray->setPolarization(p_pol); |
152 | ray->setPolarization(p_pol); |
151 | 153 | ||
152 | ray->DrawS(cx, -5.0); |
154 | ray->DrawS(cx, -5.0); |
153 | 155 | ||
154 | CRay |
156 | CRay out; |
155 | out |
157 | out.SetColor(kBlack); |
156 | TVector3 *inters = new TVector3; |
158 | TVector3 *inters = new TVector3; |
157 | surf |
159 | surf.PropagateRay(*ray, out, inters); |
158 | printf(" n1 = %f, n2 = %f\n", p_n1, p_n2); |
160 | printf(" n1 = %f, n2 = %f\n", p_n1, p_n2); |
159 | //if(fate == 1) out->DrawS(cx, 5.0); |
161 | //if(fate == 1) out->DrawS(cx, 5.0); |
160 | out |
162 | out.DrawS(cx, 5.0); |
161 | 163 | ||
162 | CRay *incidentPolarization = new CRay; |
164 | CRay *incidentPolarization = new CRay; |
163 | incidentPolarization->SetColor(kGreen); |
165 | incidentPolarization->SetColor(kGreen); |
164 | incidentPolarization->Set(ray->GetR(), p_pol); |
166 | incidentPolarization->Set(ray->GetR(), p_pol); |
165 | incidentPolarization->DrawS(cx, 1.0); |
167 | incidentPolarization->DrawS(cx, 1.0); |
166 | printf(" GREEN: polarization vector\n"); |
168 | printf(" GREEN: polarization vector\n"); |
167 | 169 | ||
168 | CRay *surfaceNormal = new CRay; |
170 | CRay *surfaceNormal = new CRay; |
169 | surfaceNormal->SetColor(kBlue); |
171 | surfaceNormal->SetColor(kBlue); |
170 | surfaceNormal->Set(ray->GetR(), surf |
172 | surfaceNormal->Set(ray->GetR(), surf.GetN()); |
171 | surfaceNormal->DrawS(cx, 1.0); |
173 | surfaceNormal->DrawS(cx, 1.0); |
172 | printf(" BLUE: surface normal vector\n"); |
174 | printf(" BLUE: surface normal vector\n"); |
173 | } |
175 | } |
174 | 176 | ||
175 | void ptt() |
177 | void ptt() |