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 / Overriding object's world matrix causes it to disappear sometimes

Author
Message
Zotoaster
14
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Jun 2012 14:42
Hey all, I was wondering if anyone knows what's happening here.

I'm trying to manually modify an object's position, rotation and scale by overriding it's world matrix, but depending on it's position relative to the camera, it seems to not appear sometimes.

First, I'm saying to the object I want to override it's matrix, then later simply applying a matrix to it:


Note that this does position, rotate and scale the object properly, but I have a suspicion it has something to do with the camera's view matrix or something.

Any help would be appreciated.

"everyone forgets a semi-colon sometimes." - Phaelax
Matty H
10
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Jun 2012 15:47
You need to set it's position also, you can do this inside the sObject structure or you can just use dbPositionObject().

The object is being culled when the culling system thinks it is off screen, updating the objects position fixes this. You can also disable culling by using dbSetObjectRadius(ID, -1) but that might not be the best solution.

Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Jun 2012 16:00
The position information is contained within the last row or colum of the matrix depending on the convention DX uses (can't remember which atm)

[b]
Zotoaster
14
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Jun 2012 16:18 Edited at: 10th Jun 2012 16:19
That worked Matty, thanks!

[edit]

Diggsey, thanks, I found a function though called D3DXMatrixDecompose() which will give you a scale vector, rotation quaternion and position vector from a world matrix, it's pretty cool.

"everyone forgets a semi-colon sometimes." - Phaelax

Login to post a reply

Server time is: 2019-09-23 03:30:10
Your offset time is: 2019-09-23 03:30:10