continue renderSuite toolkit development

This commit is contained in:
dymik739 2023-05-20 10:59:09 +03:00
parent d606f6994f
commit 03bbb6e4c5
2 changed files with 40 additions and 2 deletions

View File

@ -4,8 +4,7 @@ import renderSuite.Vec3;
import renderSuite.Util; import renderSuite.Util;
import renderSuite.Ray; import renderSuite.Ray;
public class Sphere { public class Sphere extends Surface {
Vec3 p, c;
double r; double r;
public Sphere(Vec3 position, Vec3 color, double radius) { public Sphere(Vec3 position, Vec3 color, double radius) {

View File

@ -0,0 +1,39 @@
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);
}
*/
}