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 / exporting Matrix to .x / .dbo?

Author
Message
Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 23rd Feb 2012 18:54
Hello,
The FPS is dropping horrible if i use a matrix. For my Map Editor it's okay, but not if i would do it in my game.

So, is there a way to export the matrix to make it faster?
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Feb 2012 19:15 Edited at: 24th Feb 2012 02:39
yup....you can code it into a fresh object using the matrix dlls

are you familiar working with vertex's and indexes?

you would need to setup some functions to code a dbo file or mesh file from the matrix and then you would need to reconstruct the command get ground height to pull info from vertex data instead.

I agree with you that the matrix commands are too slow for gameplay unless you make it smaller and buffer the changes in while your screen moves.

keep in mind each square in a matrix consists of 2 triangles and each square needs its own individual vertex data or you will have uv mapping issues.

So idealy you would have 4 vertex data per square and 6 indexes per square representing the 2 triangles. Then you would need to setup some commands to lay out uv data accordingly.

Humm.... mabey i will code this for ya as i may want this for future coding. Could be fun..... anyone else want this ability?


edit: will you be wanting commands to pull ground height? or just wanted to use a collision dll?

Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 23rd Feb 2012 19:31
Hehe that would be awesome!
No i think i don't need a ground height
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Feb 2012 19:37 Edited at: 23rd Feb 2012 19:40
id like to code the ground height in anyways i think..... it could be a complete matrix replacement command set using a single object/ limb for it.

Ill start working on it now


edit : 1 question..... do you want the matrix object to start at x,y uncentered as a matrix is or be center within the size of it?

eg 0,0,0 will be center of the matrix or the start of it?(corner of it)

Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 23rd Feb 2012 19:49
The Start
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Feb 2012 20:22
ok ill get worken on it

should have something by tonight or tomorow at the latest

Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 23rd Feb 2012 20:46 Edited at: 23rd Feb 2012 20:47
Okay. Will the texture be a UV Map or just a normal plain texture?
Because i'm thinking about howto export my tile textures into 1 for the x / dbo.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Feb 2012 21:36
ill try to set it up so its the same as the matrix commands for texturing

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Feb 2012 22:32 Edited at: 23rd Feb 2012 23:12
to make this easier to do i will just make the function convert a matrix to object only....but later even if you want you can expand on it.

edit: ok so there is a set matrix tile command but not a get matrix tile command? Ok this sucks but i will code a work around like most people do. 90% done btw...

Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 24th Feb 2012 00:44
No there's no get matrix tile command. Have to store it in an array.

90%? Wow impressive.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Feb 2012 00:59 Edited at: 24th Feb 2012 01:08
here it is....enjoy!




You will need the matrix dlls for this to work!!

Ill search for the thread and post the link

edit:here is the link to the dlls needed.
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18



Let me know if your having trouble with the conversion?

Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 24th Feb 2012 01:19 Edited at: 24th Feb 2012 01:21
Wow that's a code... and it's working perfect!
Thank you very much

But is it just my mind, or is there something changing when you're convert it to an object?
Couldn't see any difference, but it looks like there's something changing?

e/ Oh, and that idea of the makematrix function is great too, maybe you should make a plugin or something out of it
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Feb 2012 01:52
i think slightly i see the texture alignment change in this sample .....but im not sure....

I bet it makes the alignment better then it was before.

I know that i never set the matrix trim on this example.....

So it corrects it anyways on the object

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Feb 2012 02:45
Ah i just figured it out...lol

The triangles join on the opposite side from the matrix command.... i will fix and repost

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Feb 2012 02:59 Edited at: 24th Feb 2012 03:07
Ok now the triangles are flipped.... now you only see a slight texture slide to the left as the object has perfect alignment unlike the matrix command set. with the matrix stuff you need to set the trim to make it look correct. this will just fix it and convert it on the spot.



Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 25th Feb 2012 04:29
Ah nice, thank you
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 29th Feb 2012 05:40 Edited at: 29th Feb 2012 05:43
if it's possible to turn an matrix into a object then using

Dark Occlusion you can have many matrix's

in one example 4096 animated objects are loaded

my system is a dual 2.8 ghz 2 gb ram 1 gb Geforce nivia GTS 250

the example says you can do 1,048,576 but when I put that it in
it was going to take a long time to do

but 16,384 is possible on my system

just some thing to think about

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2024-04-26 15:46:42
Your offset time is: 2024-04-26 15:46:42