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 Discussion / Aligning an object to a matrix... need function

Author
Message
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 30th Jul 2004 03:48
Hey everyone!

I'm stuck on a problem... i want to align objects to my matrix, like a car that drives up a hill ya know... i can do it with pitch up and Roll left etc. commands, thats easy, but i'm no good at euler rotation and i need it, because if you use both free flight commands and euler rotation, the angles snap back to 0,0,0 ...

So my Q is... can anyone of you write me a function to do this? Just a simple one is enough, it's for an RTS game, so easy, quick functions are better.

Juzt a dude who likez progging - Me loves RTS games
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 30th Jul 2004 05:22
Have a look at the tank deno. That's got a good bit of code for aligning an object to a matrix.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 30th Jul 2004 07:12
Yeah i know... i tried to use that code, i stripped it out and recoded it... sadly, it didn't work at all

Juzt a dude who likez progging - Me loves RTS games
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 30th Jul 2004 07:26
Here is the code... it comes from the tank game and it's placed in a function... the object is positioned well, but it doesn't rotates


Juzt a dude who likez progging - Me loves RTS games
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Jul 2004 09:04
You'll have to use a dummy object, like they did in the tank demo.

I wrote this for the old ski compo I never entered.



"eureka" - Archimedes
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 30th Jul 2004 23:05
Hmm... pretty confusing code, phaelax, sorry

Juzt a dude who likez progging - Me loves RTS games
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 31st Jul 2004 00:33
just look at the binary moon tutorial, that eehm.. is something with a hovercraft.. it is a darkbasic classic tutorial, but it works in pro too

syntax error??? it isn't an error, it is a feature

Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 31st Jul 2004 01:55
Hey good one jopie dopie... i'll give it a try

Juzt a dude who likez progging - Me loves RTS games
ZioNz
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 31st Jul 2004 03:22
I use this function to align my objects in a matrix. Your matrix should be number 1 or you will have to change some code parts. Its for DBPro but i think it should work in clasic.




-
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 31st Jul 2004 07:39
Quote: "Hey good one jopie dopie"


Thanks , i learned it from that tutorial.

syntax error??? it isn't an error, it is a feature

Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Jul 2004 09:24
There's now 3 sources on this page that all use the same basic method.

"eureka" - Archimedes
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 31st Jul 2004 15:36
Yeah i know... and i still don't get it working... but i'll keep trying!

Juzt a dude who likez progging - Me loves RTS games
Impreza
22
Years of Service
User Offline
Joined: 7th Nov 2002
Location:
Posted: 31st Jul 2004 17:19
try using TMC's db code: http://66.98.192.31/~maskedc/dbcode/dbcode.htm

set mipmap mode 1: set matrix texture 1,1,1: set spot light 1,0,90: set normalization on: sync rate 0: statistic(1): flush video memory
autocam off: always active on: hide mouse: set window on
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 2nd Aug 2004 00:25
Never mind, i've done it But thanks anyway for giving me some code, it really helped me figuring out the bits an pieces of it

Juzt a dude who likez progging - Me loves RTS games

Login to post a reply

Server time is: 2025-05-25 22:36:26
Your offset time is: 2025-05-25 22:36:26