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 / Object's World Matrix

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 26th Aug 2003 18:00
Is there anyway I can alter an object's world matrix, i.e. the matrix that controls an object rotation and position in world space. Right now, the only way to alter the object rotation/position is thru the POSITION OBJECT and ROTATE OBJECT commands. Sometimes, these commands doesn't work as I need to construct it's world matrix by some matrix math.

For example, let say that I wanted to orient the object based on an arbitary axes, namely alpha, beta, and gamma. These are 3 orthogonal vectors that I calculated for my object orientation. By some basic knowledge of matrix math, I know I can construct the object world matrix as follows:



Assume that the position vector is a row vector.

In Direct3D, I know I can use the following command,
device->SetTransform(D3DTS_WORLDMATRIX, &worldMatrix);

Is there anyway that this command is exposed to DBpro?

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Aug 2003 20:20
No, I don't believe so.

There are vector commands for cameras, matrixs and particles, but none for objects. Also, there is no direct access to matrices.
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 27th Aug 2003 19:10
Crap, then there is no way I can create an axial billboard as described at http://www.flipcode.com/articles/article_rtr2billboards.shtml



Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Beta 1
22
Years of Service
User Offline
Joined: 27th Aug 2003
Location:
Posted: 27th Aug 2003 19:34
Let me get this right you want to have an object as a billboard that is pointing at the camera at all times? Like in most of those examples - lens flare flat trees etc.

Isnt there a point object command? Just point it at the camera!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Aug 2003 21:24
If your billboards just need to rotate around the Y axis then it may be quicker to use ATANFULL to work out the angle, and YROTATE OBJECT to adjust it. At least that's what one of the guys on DBDN found.
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Aug 2003 08:48
The problem is, the billboard can be pivoted on any arbitary axis, not necessary on Y-axis, for example, those laser beams in space combat game.

Well, I guess I am pretty much screwed.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/

Login to post a reply

Server time is: 2026-07-23 00:17:36
Your offset time is: 2026-07-23 00:17:36