1 registered members (TipmyPip),
18,633
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Bounding Box and Rendering
#395879
02/28/12 18:54
02/28/12 18:54
|
Joined: Sep 2007
Posts: 101 Luxembourg
krial057
OP
Member
|
OP
Member
Joined: Sep 2007
Posts: 101
Luxembourg
|
Hey, Before you leave, notice that this is not one more of those Threads about malfunctions of collisions or setting the bounding box correctly  I have a Model whose bounding box is changed at runtime. However, the render process of 3dgs seems to ignore this. If the camera gets out of range of the default bounding box, the Model is getting invisible(frustum culling?). However it takes the default bounding box of the Model and not the one that was changed via Script. Here is a small Script to demonstrate(simply create a Model that grows in size to see the effect):
void actFrustumTest()
{
wait(1);
set(me, FAT|NARROW);
vec_set(my->min_x, vector(-100, -100, -100));
vec_set(my->max_x, vector( 100, 100, 100));
while(1)
{
if(is(me, CLIPPED))
draw_text("clipped :S", 10, 10, COLOR_RED); wait(1);
}
}
int main()
{
fps_max=60;
level_load(NULL);
ent_create("someAnimatedModel.mdl", nullvector, actFrustumTest);
return 0;
}
I have to resize the Bounding box, because the Model is animated and grows in size. As a workaround I placed 2 vertices in the Model to set the real size(or I could simply copy the last frame as the first). Isn't there a way that GS is just always using the bounding box from the script? EDIT: I have the latest A7 version
Last edited by krial057; 02/28/12 18:56.
|
|
|
Re: Bounding Box and Rendering
[Re: Superku]
#395883
02/28/12 19:55
02/28/12 19:55
|
Joined: Sep 2007
Posts: 101 Luxembourg
krial057
OP
Member
|
OP
Member
Joined: Sep 2007
Posts: 101
Luxembourg
|
Hmm... thank you The clipfactor won't help me much, because I don't have A8. I think I will modify the model with a copy of the last frame as the first(hope that will fix it). Btw. your code does not make much sense as CLIPPED is no "flag", but an "eflag", thus the is/set/toggle macros won't help here. Use the following code instead: if(my.eflags&CLIPPED)
ouch, true, ty. Need to have a short rest xD
Last edited by krial057; 02/28/12 19:56.
|
|
|
Re: Bounding Box and Rendering
[Re: Superku]
#395891
02/28/12 21:36
02/28/12 21:36
|
Joined: Sep 2007
Posts: 101 Luxembourg
krial057
OP
Member
|
OP
Member
Joined: Sep 2007
Posts: 101
Luxembourg
|
Everything goes wrong today -.- Now I copied the last frame to the first frame and the render issue is fixed. However i can't manage to update the hull to the 2nd frame(sorry if it has nothing to do with this thread)
void actTest()
{
wait(1);
ent_animate(me, "explosion", 0, NULL);
c_updatehull(me, 2);
}
int main()
{
sky_color.red=50;
sky_color.green=50;
sky_color.blue=50;
fps_max=60;
level_load(NULL);
ent_create("E_Plattform_A1_01.mdl", nullvector, actTest);
return 0;
}
If there is no problem in the code, here is the model is use: http://dl.dropbox.com/u/6859456/E_Plattform_A1_01.mdlI found a thread with a similar Problem but without solution http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=306571
Last edited by krial057; 02/28/12 21:37.
|
|
|
|