Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / limb sizes

Author
Message
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 22nd Dec 2007 21:23
need commands to return the sizes of limbs - a limb alternative to dbObjectSizeX/Y/Z() basically. Suggestions on best way to acheive this? I imagine this will end up being done with the DBO headers, just checking to see if anyone has already done it first.

Thanks

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Dec 2007 00:54
Scope out the Code for "Lost In Thoughts's" frustrum limb culling - he has code that fully interrogates the object and limbs - and records the highest values - to sort of get a Bounding box for ONSCREEN or OFFSCREEN functionality it has.

He basically interrogates the object limbs for the number of vetices, and then loops through reading each vertex - and uses those coordinates to get the "size" of it by sort of keeping track of MAX-X, Min X, Max Y, Min Y, Max Z, Min Z.... but organizes basically 8 sets of x,y,z coords - that "encompass" the limb.

I hope that can help you.

Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 23rd Dec 2007 02:36
hmm, sounds simular to some of my plans. one of which was to generate bounding boxes and cull hidden limbs. shame about having to read the xyz data to do it though. best bet sounds to generate a list for each object so you can look it up when needed rather than read the vertex data every time, i'll investigate

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Dec 2007 05:09
That's how LIT did it. Well.. He READS all the info first and keeps a list of only the "Bounding" Verts - the min's and Max's for each plain - then he doesn't read the vertex data again. He just loops through the list he's made and checks if its within the "frustrum" (view port).

Yeah - in a main loop - for something like that - reading vertex data each iteration - well... that would just be awful.

Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 23rd Dec 2007 13:23
The interesting thing is of course that the widest part of the viewable object changes depending on the camera angle. I think my approach to this would be to generate a lookup table sorted by limbID which stored each limbs verts and when I wanted to check the bounding box I would transform each vert into screen space (which would naturally be based off the camera) and compare the screen x of that vert to another vert to see if its the furthest in one direction (ie, edge of box) and generate a "real" screen bounding box that way.

I would however like to take a gander at LIT's code and see if he had any better ideas and check out his implementation - but I cant find it anywhere? Any idea where it is?

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Dec 2007 14:35
Here's a old copy - but it works as is - is DarkBasic Pro code though - and he used the bounding box against the screen frustrum - so it works regardless of cam angle.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-17 00:38:24
Your offset time is: 2024-11-17 00:38:24