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 / What is the command "world matrix4" good for?

Author
Message
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 23rd Mar 2011 02:32
The help docs say that "world matrix4" sets the matrix given in the arguments to the world matrix.

Is there any way to get a particular object's world matrix, without constructing it from angles, position, and scaling?

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 23rd Mar 2011 04:56
ALSO. Just adding this question on...

Matrix4 commands are GPU "accelerated", right? They call the corresponding direct3d commands? I'm guessing this is true, because otherwise the matrix4 commands would be pretty slow.

Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 23rd Mar 2011 14:54
Quote: "Is there any way to get a particular object's world matrix, without constructing it from angles, position, and scaling?"

you'll have to use dk shop or dk avm plugins

Quote: "Matrix4 commands are GPU "accelerated", right?"

i doubt it

Quote: "They call the corresponding direct3d commands?"

yes

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 23rd Mar 2011 15:40
Ah, just did some more research into it, and I'm pretty sure the matrix4 commands are gpu "accelerated". Accelerated is in parentheses because... well... I'm pretty sure all Direct3D matrix commands use the GPU for calculating transformations, because that's what the GPU is designed to do. I had a program running with about 19 matrix multiplications total, and it was running at like 1900 FPS. That seems like a bit much for the processor to be able to do! (I don't have a souped up computer, this is my laptop)

Still... I see no point to the world matrix4 command.

Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 23rd Mar 2011 17:26 Edited at: 16th Oct 2011 05:38
A good example of how and why you would use world matrix4.

http://forum.thegamecreators.com/?m=forum_view&t=169866&b=1


I have used it in many of my projects.


[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Mar 2011 21:49 Edited at: 23rd Mar 2011 21:49
No, D3DX matrices work on the CPU not the GPU. Most of their code is inlined so you can see it. The part that's accelerated is when you send the vertices to the GPU, they will be transformed by the current world view and projection matrices on the GPU.

[b]
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 24th Mar 2011 02:29
^^Ah... K.

Anyways... Stab in the Dark, in that thread, kira vakaan said:
Quote: "In DBPro, world matrix4 will always return the identity matrix"


And... as far as I can tell, that's true!

Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Mar 2011 16:48 Edited at: 28th Mar 2011 03:57
Neuro here is the easiest way I found to get an objects world matrix.Iam not sure if this will help you.





[img][/img]


Custom,intel 3.0GHz Hyper Threaded,4GB RAM,ATI X1500 256mb,
WindowsXP DBpro v7.5 Synergy
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2011 18:05
Quote: "What is the command "world matrix4" good for?"


Quote: "Anyways... Stab in the Dark, in that thread, kira vakaan said:

Quote: "In DBPro, world matrix4 will always return the identity matrix""


Quote: "And... as far as I can tell, that's true!"


Yes, I've often wondered what the point of that command was too.

Login to post a reply

Server time is: 2026-07-17 12:04:38
Your offset time is: 2026-07-17 12:04:38