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.

DarkBASIC Professional Discussion / Object bounds / Camera edges

Author
Message
FDC002
10
Years of Service
User Offline
Joined: 24th Feb 2015
Location:
Posted: 24th Feb 2015 22:33 Edited at: 25th Feb 2015 15:59
Hi,

I have a problem with object bounds.

I modify an object vertices and i try to recalculate object bounds otherwise the camera considers the object out of the field of view when it's on its edge.

I made a small code to explain(db pro v1.0761) :



how to test :

test 1:
Start the default program (part A not commented and part B commented).
Push return once, you will see the object get higher.(object's coordinates are actually still 0,0,0. All individual vertices have been offset by 15)
if you aim the camera up with the mouse, the object should disappear before it leaves the screen at the bottom, the camera considering it's still down there.
you can push space to recalculate object bounds or hide and show them with control. It won't refresh

test 2:
Set part A and B as comments so the bounds are not shown at start
push return once
push space to calculate bounds and then control to display them.
you will see the the new bounds are correct but the "object disappearing" problem remains

test 3:
Set part B uncommented and keep part A commented
This will offset the vertices by 15 and recalculate the bounds which is what we did manually so far. But the fact that it's done before setting the camera position solve the screen edge problem.
if you move camera up and down the object should not disappear
controlkey should display the correct bounds as long as you don't move the vertices with return

If anyone knows how i could modify vertices and recalculate bounds after repositioning the camera that would help me a lot.
Any advice might help, thanks for testing.

Bye
FDC002
10
Years of Service
User Offline
Joined: 24th Feb 2015
Location:
Posted: 25th Feb 2015 18:31 Edited at: 25th Feb 2015 18:46
rotating the object after calculating the new bounds triggers the refresher i need.

in the code above try replacing



by



still am wondering if a dll function could trigger the "refresher" without fake rotating the object. Those camera fov bounds seems to be independant to the dbpro bounds. You can display the wrong bounds(control key) with the new code even though the camera is working fine. If anyone is familiar with this please don't hesitate to add some information here like how does directx handle those mysterious bounds, what are the directx call included in "xrotate object" or "rotate object" that solve the camera issue. By the way positioning the object doesn't include those calls.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 26th Feb 2015 03:30
It would seem the bounding sphere/box is centred round the world limb position of the object and not actually where there is a mesh. Nor does the display bounds seem to change size. Hmm... this is interesting?

Also it's not like you can post in bugs report cause DBP isn't getting any updates at all it would seem.

I wonder if there's a way to set a new limb position (not offset). preferable we should be able to define our own bounds.

"Get in the Van!" - Van B
FDC002
10
Years of Service
User Offline
Joined: 24th Feb 2015
Location:
Posted: 26th Feb 2015 05:39
look at test 3. The white box and sphere are correctly updated according to the modified vertices without touching the limbs. It's just a certain call that is made inside the rotate object and at the first camera positioning that fixes the out of screen problem. About the white box and sphere bounds i guess they are for collision. Not sure if I will use them yet anyway.
I don't know either about the limb position functions.
Thanks for having a look maybe a someone who went into making dlls about objects will have more information.

Login to post a reply

Server time is: 2025-05-12 04:56:26
Your offset time is: 2025-05-12 04:56:26