shithub: 3dee

Download patch

ref: 7a07b2c636e42a95920ff5a4edfef4b9c3fbd729
parent: 4605adef59010fa2ed74b862e8169baf73680bf4
author: rodri <rgl@antares-labs.eu>
date: Sat Aug 17 08:45:25 EDT 2024

use the new light types constants.

--- a/med.c
+++ b/med.c
@@ -802,7 +802,7 @@
 	placecamera(cam, scene, camcfg.p, camcfg.lookat, camcfg.up);
 	light.p = Pt3(0,100,100,1);
 	light.c = Pt3(1,1,1,1);
-	light.type = LIGHT_POINT;
+	light.type = LightPoint;
 	tsampler = neartexsampler;
 
 	kctl = emalloc(sizeof *kctl);
--- a/vis.c
+++ b/vis.c
@@ -733,6 +733,13 @@
 		for(idx = 0; idx < nelem(cams); idx++)
 			memset(&cams[idx]->stats, 0, sizeof(cams[idx]->stats));
 	}
+//	if(om.buttons == mctl->buttons){
+//		Point p;
+//
+//		p = subpt(mctl->xy, om.xy);
+//		maincam->view->p.x += p.x;
+//		maincam->view->p.y += p.y;
+//	}
 	unlockdisplay(display);
 	nbsend(drawc, nil);
 }
@@ -1023,7 +1030,8 @@
 		else
 			cams[i] = Cam(Rect(0,0,fbw,fbh), rctl,
 					camcfgs[i].ptype, camcfgs[i].fov, camcfgs[i].clipn, camcfgs[i].clipf);
-
+		if(cams[i] == nil)
+			sysfatal("Cam: %r");
 		placecamera(cams[i], scene, camcfgs[i].p, camcfgs[i].lookat, camcfgs[i].up);
 		cams[i]->view->setscale(cams[i]->view, scale, scale);
 
@@ -1039,8 +1047,8 @@
 	light.p = Pt3(0,100,100,1);
 //	light.dir = Vec3(0,-1,0);
 	light.c = Pt3(1,1,1,1);
-	light.type = LIGHT_POINT;
-//	light.type = LIGHT_SPOT;
+	light.type = LightPoint;
+//	light.type = LightSpot;
 //	light.θu = 30*DEG;
 //	light.θp = 5*DEG;
 	tsampler = neartexsampler;