Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bounding Box and Rendering #395879
02/28/12 18:54
02/28/12 18:54
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

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 wink

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):

Php Code:
#include <acknex.h>
#include <default.c>

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); // Clipped is never set -.-
		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: krial057] #395882
02/28/12 19:26
02/28/12 19:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There is no relation between the (size of the) bounding box and clipping, the usual bounding box (that you can set via the min/max vectors) is only used for collision detection. AFAIK you don't have access to the "visual bounding box" that determines clipping, but you can use the entity variable clipfactor to change the clipping behaviour of a single entity.
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)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Bounding Box and Rendering [Re: Superku] #395883
02/28/12 19:55
02/28/12 19:55
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

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).
Quote:

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: krial057] #395884
02/28/12 20:04
02/28/12 20:04
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Sorry, I didn't know that clipfactor is an A8 feature.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Bounding Box and Rendering [Re: Superku] #395891
02/28/12 21:36
02/28/12 21:36
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

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) tongue

Php Code:
#include <acknex.h>
#include <default.c>

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.mdl

I 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.

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1