40 lines
842 B
Java
40 lines
842 B
Java
|
package renderSuite;
|
||
|
|
||
|
import renderSuite.Vec3;
|
||
|
//import renderSuite.Util;
|
||
|
//import renderSuite.Ray;
|
||
|
|
||
|
public class Surface {
|
||
|
Vec3 p, c;
|
||
|
|
||
|
public void main() {
|
||
|
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
public boolean intersect(Ray r) {
|
||
|
// OLD
|
||
|
//double dist = Util.d(ray_position, position);
|
||
|
//return (Util.d(ray_position, position) <= radius);
|
||
|
|
||
|
// using RTX
|
||
|
Vec3 l = new Vec3(this.p.x - r.p.x,
|
||
|
this.p.y - r.p.y,
|
||
|
this.p.z - r.p.z);
|
||
|
|
||
|
Vec3 nl = l.get_norm();
|
||
|
double cosine = Util.dot(r.f, nl);
|
||
|
|
||
|
// >90 degrees = no intersection
|
||
|
if (cosine < 0) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
double tc = l.len() * cosine;
|
||
|
double d = Math.sqrt( l.len()*l.len() - tc*tc );
|
||
|
|
||
|
return (d < this.r);
|
||
|
}
|
||
|
*/
|
||
|
}
|