|
Re: VIEW not taking into account entity distance for scaling
[Re: Reconnoiter]
#450945
04/25/15 11:19
04/25/15 11:19
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
If you are about to use ISOMETRIC view, take a look here. Best regards
|
|
|
Re: VIEW not taking into account entity distance for scaling
[Re: 3run]
#450947
04/25/15 11:36
04/25/15 11:36
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
funny enough I just saw your thread, but thanks anyway its usefull. Still know how to the above?
Last edited by Reconnoiter; 04/25/15 12:32.
|
|
|
Re: VIEW not taking into account entity distance for scaling
[Re: Reconnoiter]
#450948
04/25/15 11:50
04/25/15 11:50
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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):
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'.
|
|
|
Re: VIEW not taking into account entity distance for scaling
[Re: 3run]
#450949
04/25/15 12:29
04/25/15 12:29
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
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.
Last edited by Reconnoiter; 04/25/15 12:36.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|