VIEW not taking into account entity distance for scaling

Posted By: Reconnoiter

VIEW not taking into account entity distance for scaling - 04/25/15 11:17

Hi,

VIEW not taking into account entity distance for scaling, how to do this?

Basically I want that an entity of the same type that is far away looks the same in size as an entity that is very close.

I have already set the view to Isometric, but I need to change the arc for zooming in and zooming out (changing the z does not do the trick).

tnx
Posted By: 3run

Re: VIEW not taking into account entity distance for scaling - 04/25/15 11:19

If you are about to use ISOMETRIC view, take a look here.

Best regards
Posted By: Reconnoiter

Re: VIEW not taking into account entity distance for scaling - 04/25/15 11:36

funny enough I just saw your thread, but thanks anyway its usefull. Still know how to the above?
Posted By: 3run

Re: VIEW not taking into account entity distance for scaling - 04/25/15 11:50

Originally Posted By: Reconnoiter
funny enough I just saw your thread, but thanks anyway its usefull. Still know how to the above? I also about maybe using a shader but that would distort graphics in my other normal/camera view.
I missunderstood you at the first place, but try the following (I can't garantee that it will work perfect, but it works for me):
Code:
void main(){
	fps_max = 60;
	level_load("");
	
	vec_set(sky_color, COLOR_BLACK);
	
	var distToCamera[3];
	
	ENTITY* testEnt = ent_create(CUBE_MDL, vector(200, 0, 0), NULL);
	set(testEnt, UNLIT);
	testEnt.ambient = 100;
	
	ENTITY* testEnt2 = ent_create(CUBE_MDL, vector(1000, -250, 0), NULL);
	set(testEnt2, UNLIT);
	testEnt2.ambient = 100;

	ENTITY* testEnt3 = ent_create(CUBE_MDL, vector(1000, 250, 0), NULL);
	set(testEnt3, UNLIT);
	testEnt3.ambient = 100;

	while(1){
		
		testEnt.skill1 += 5 * time_step;
		vec_fill(testEnt.pan, testEnt.skill1);		
		vec_fill(testEnt2.pan, testEnt.skill1);
		vec_fill(testEnt3.pan, testEnt.skill1);
		
		distToCamera[0] = vec_dist(camera.x, testEnt.x) / 200;
		vec_fill(testEnt.scale_x, maxv(1, 1 * distToCamera[0]));

		distToCamera[1] = vec_dist(camera.x, testEnt2.x) / 200;
		vec_fill(testEnt2.scale_x, maxv(1, 1 * distToCamera[1]));
		
		distToCamera[2] = vec_dist(camera.x, testEnt3.x) / 200;
		vec_fill(testEnt3.scale_x, maxv(1, 1 * distToCamera[2]));

		wait(1);
	}

}



Best regards

Edit: btw, if I understood you correctly, it has nothing to do with VIEW at all (especially with ISOMETRIC projection). In the code above, I guess it needs better (more accurate) size correction, cause the one I've made is just for you to give an idea. Play with '200' value at the end of each 'distToCamera'.
Posted By: Reconnoiter

Re: VIEW not taking into account entity distance for scaling - 04/25/15 12:29

That would be very heavy with lots of ents (especially since the view can be moved) and would distort the other view.

edit; a postprocessing shader would do the trick I think, but I have no idea which one if there is a predefined one that does this effect.
© 2024 lite-C Forums