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 / Rotating Matrix from XZ to XY.

Author
Message
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 5th Nov 2012 01:59 Edited at: 5th Nov 2012 06:35
Hi Everyone,

I started thinking about a 2D side scroller but done in 3D. My first thought was I'd like a ground matrix, in the default XZ plane, but then also a backdrop matrix in the XY plane too.

So I started investigating how to rotate a matrix 90° and found this thread; specifically the post by Dmitry K.

http://forum.thegamecreators.com/?m=forum_view&t=40645&b=1&msg=410530#m410530

But I can't get the DLL calls to work, I keep getting an error whilst using the latest 1.077 DBpro.

Does anyone know of a different technique to rotate a matrix into a different orientation, or does anyone know why Dmitry K's code is now failing?

Cheers in advance,
BFM

Alternatively, perhaps if I could be shown how to update clist regarding DLL calls, perhaps the DLL has been updated and the call changed.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Nov 2012 15:01
Why use a matrix for a backdrop?

Why not something like this:

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 5th Nov 2012 23:35 Edited at: 6th Nov 2012 01:01
Whoa, that's trippy... not too sure what to think!

Let me show you what I've got in mind with a picture, it'll explain things better.



Camera 0 will focus as per the direction shown, which will allow standard side scroller functionality. I can do the XZ plane with the stand DBpro matrix, but I'm not too sure how to create the vertical standing YX plane... If I could rotate a XZ plane by 90 degrees, I'd be sorted! But I can't, and that's where I need some ideas from experienced forum goers, like you! =D

EDIT:

In further editing the code from my OP, it seems that the code rotates Objects, but not matrix, as per below.



Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Nov 2012 01:03
Any reason why you can't use a standard plain object for the task - or must it be adjustable like a matrix??
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 6th Nov 2012 01:56 Edited at: 6th Nov 2012 02:30
I've been thinking about writing a prototype that uses multiple plane objects, but am worried performance would take a hit, hence I need to test it first. Multiple plane objects would also need to be manually coded/scripted, but no doubt would result in something much more flexible.

I need to sketch out my ideas more.

EDIT: But alas, I'm still curious as to if rotating a matrix is possible! ^____^

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Nov 2012 00:40
If the vertical matrix will be fairly simple and you are using it just to texture each tile then just create a second matrix with a really small y size and change the heights of each tile to build the wall. If possible though you should steer away from matrices as they are not 'proper' objects and do not react as nicely to lighting effects plus large matrices can slow your game down a fair bit.



Boo!
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 8th Nov 2012 10:09
why not use the old matrix object code snippet that someone created forever ago. Sorry about not giving credit to who created it. I haven't seen the snippet in a while.
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 8th Nov 2012 11:30
You guys are too kind, thank you so much! I'd thought about changing the height of a matrix, but always assumed the textures would go screwy/stretchy... but thanks to your demo, it works!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Nov 2012 13:36
Nice one spooky. Wish I'd thought of that.

Login to post a reply

Server time is: 2026-07-11 02:03:02
Your offset time is: 2026-07-11 02:03:02