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 / No "rotate matrix" command ?!

Author
Message
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 9th Nov 2004 16:06 Edited at: 9th Nov 2004 16:10
This morning [Edit: I say "this morning" 'cos it's 8:50 AM, here], I tried to put a small ghosted matrix in a box to simulate some water in a tank. Quite easy: water effect with matrices is a common thread in the forums.

But then, I've tried to move and turn the box around and I realised that there was no "rotate matrix" command (or equivalent). I understand that rotations on the X or Z axis could be difficult (the "get matrix height" maths would be tricky, I guess), but there's not even a "Yrotate matrix" command.

Did I miss anything, or should I resign to build my own "matrix-like-mesh" with memblocks ?

Ideas: memories of things which did not occur yet...
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Nov 2004 00:13
matrix wasn't meant to be used in that way. the update speed of memblock matrices is too slow for real-time effects. Why would you need to rotate the matrix for water effects anyway? If you already got moving waves, then a circular motion would really add to the realism.

"eureka" - Archimedes
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Nov 2004 11:47
Not sure what your program needs to do, but one way to get the same effect would be to rotate the camera and the box by the same amount.

This would look like the matrix was rotating as the brain would be fooled into thinking that as the box was stationary the camera wan't moving.

If your camera needs to be outside the 'tank', then obviously this method won't work.

In the example below, you will need to put a suitable water.bmp texture in the same directory as the DBA code.

TDK_Man

Login to post a reply

Server time is: 2025-05-24 12:24:58
Your offset time is: 2025-05-24 12:24:58