Nice try Widi, but I cant seem to get that to work...
I CANNOT get ANY c_trace's to hit the inside of the polygons for some reason...

I tried a few hours ago and the traces pass straight through...

Heres how I was testing it...
Click to reveal..
Code:
#include <acknex.h>
#include <default.c>

void main()
{
	level_load(NULL);		wait(1);		vec_set(camera.x, vector(-50, 0, 15));
	
	ent_create(CUBE_MDL, vector(20,20,20), NULL);	//'spare' target

	me = ent_create(CUBE_MDL, nullvector, NULL);
	wait(1);		c_setminmax(me);
	set(me, LIGHT);		vec_set(me.blue, vector(0,0,200));

	VECTOR to;	vec_set(to, vector(me.x, me.y, me.z+20));
	
	while(1)
	{
		to.x += (key_cuu  - key_cud) / 5 * time_step;
		to.y += (key_cul  - key_cur) / 5 * time_step;
		to.z += (key_home - key_end) / 5 * time_step;

		var dist = c_trace(me.x, to, USE_POLYGON);

		if(dist != 0)
		{	draw_line3d(me.x, COLOR_RED, 100);
			draw_line3d(to, COLOR_RED, 100);	
			draw_point3d(hit.x, COLOR_RED, 100, 0.25);
			draw_text("HITTING!", 10, 10, COLOR_RED);			}

		if(dist == 0)
		{	draw_line3d(me.x, COLOR_BLUE, 100);
			draw_line3d(to, COLOR_BLUE, 100);
			draw_text("NOT hitting.", 10, 10, COLOR_BLUE);	}
			
		wait(1);
	}	
}


I tried it with various combinations of mode flags and so forth,
but never got it to detect hitting the 'red' cube...
(yes I tried without using the LIGHT flag...)

If you can spot whats wrong I would be grateful...
Im suffering lots of mental 'blanks' lately... I know this USED to work...


FYI Im using A7.86.0 commercial


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial