Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (frutza, Quad, AndrewAMD), 385 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 2 of 16 1 2 3 4 15 16
Re: newton [Re: ventilator] #113051
04/04/07 21:44
04/04/07 21:44
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Nice, can't wait for more info.

If I knew c++, I'd offer to help


xXxGuitar511
- Programmer
Re: newton [Re: xXxGuitar511] #113052
04/05/07 06:58
04/05/07 06:58
Joined: Aug 2005
Posts: 1,012
germany, dresden
ulf Offline
Serious User
ulf  Offline
Serious User

Joined: Aug 2005
Posts: 1,012
germany, dresden
very nice news ventilator!

Re: newton [Re: ulf] #113053
04/29/07 19:04
04/29/07 19:04
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
static collision geometry can be loaded from models and spheres can roll around:



still a lot to do but this is much more fun in lite-c than doing a plugin for c-script.

Re: newton [Re: ventilator] #113054
05/02/07 05:11
05/02/07 05:11
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Ventilator: I think I love you... lol. This is great news. Can't wait till it gets near completion!


xXxGuitar511
- Programmer
Re: newton [Re: xXxGuitar511] #113055
05/02/07 07:17
05/02/07 07:17
Joined: Aug 2005
Posts: 1,012
germany, dresden
ulf Offline
Serious User
ulf  Offline
Serious User

Joined: Aug 2005
Posts: 1,012
germany, dresden
very nice already, keep on going

Re: newton [Re: ulf] #113056
05/02/07 11:17
05/02/07 11:17
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline
User
bstudio  Offline
User

Joined: Aug 2006
Posts: 652
Netherlands
Hehe, this makes me more interested in lite-c then i was. Keep up the nice development


BASIC programmers never die, they GOSUB and don't RETURN.
Re: newton [Re: bstudio] #113057
05/09/07 09:05
05/09/07 09:05
Joined: Dec 2006
Posts: 65
A
andy_1984 Offline
Junior Member
andy_1984  Offline
Junior Member
A

Joined: Dec 2006
Posts: 65
can lite c be used with 3dgs or is it a totaly diffrent and can only be used standalone ?

Re: newton [Re: andy_1984] #113058
05/16/07 10:29
05/16/07 10:29
Joined: Aug 2005
Posts: 1,012
germany, dresden
ulf Offline
Serious User
ulf  Offline
Serious User

Joined: Aug 2005
Posts: 1,012
germany, dresden
litec will be part of the new gamestudio release a7 as its scripting language. but you can also grab the free version of litec right now + the free med tool modelling for non commercial projects/applications without the world editor wed.
look at the top links of this forum to get more information about this.

Re: newton [Re: ulf] #113059
05/16/07 15:56
05/16/07 15:56
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
another small step:

Code:
//----------------------------------------------------------------------------- ent_getmatrix_rb
// return transformation matrix of entity (without scale -> for rigid bodies)
//-----------------------------------------------------------------------------
void ent_getmatrix_rb(ENTITY *entity, D3DXMATRIX *mout)
{
// ignores entity scale -> not needed for rigid bodies -> collision shape size gets defined by bounding box

D3DXMATRIX mpan;
D3DXMatrixRotationZ(&mpan, entity->pan * DEG2RAD);

D3DXMATRIX mtilt;
D3DXMatrixRotationY(&mtilt, -entity->tilt * DEG2RAD); // -tilt?

D3DXMATRIX mroll;
D3DXMatrixRotationX(&mroll, entity->roll * DEG2RAD);

D3DXMATRIX mtranslation;
D3DXMatrixTranslation(&mtranslation,
entity->x * QUANTTOMETER,
entity->y * QUANTTOMETER,
entity->z * QUANTTOMETER);

D3DXMATRIX mtemp1;
D3DXMATRIX mtemp2;

D3DXMatrixMultiply(&mtemp1, &mroll, &mtilt);
D3DXMatrixMultiply(&mtemp2, &mtemp1, &mpan);
D3DXMatrixMultiply(mout, &mtemp2, &mtranslation);
}

//----------------------------------------------------------------------------- ent_getmatrix_rb
// return transformation matrix of entity (without scale -> for rigid bodies)
// (same as above but done in a different way)
//-----------------------------------------------------------------------------
//void ent_getmatrix_rb(ENTITY *entity, float *mout)
//{
// VECTOR xaxis; vec_set(&xaxis, vector(1, 0, 0));
// VECTOR yaxis; vec_set(&yaxis, vector(0, 1, 0));
// VECTOR zaxis; vec_set(&zaxis, vector(0, 0, 1));
//
// // ignores entity scale -> not needed for rigid bodies -> collision shape size gets defined by bounding box
//
// vec_rotate(&xaxis, &entity->pan);
// vec_rotate(&yaxis, &entity->pan);
// vec_rotate(&zaxis, &entity->pan);
//
// mout[0] = xaxis.x; mout[1] = xaxis.y; mout[2] = xaxis.z; mout[3] = 0;
// mout[4] = yaxis.x; mout[5] = yaxis.y; mout[6] = yaxis.z; mout[7] = 0;
// mout[8] = zaxis.x; mout[9] = zaxis.y; mout[10] = zaxis.z; mout[11] = 0;
// mout[12] = entity->x * QUANTTOMETER;
// mout[13] = entity->y * QUANTTOMETER;
// mout[14] = entity->z * QUANTTOMETER;
// mout[15] = 1;
//}

//----------------------------------------------------------------------------- ent_setmatrix_rb
//
// i think a 3dgs rotation matrix gets constructed like that:
//
// pan matrix (rotation about z-axis)
// | cos(p) -sin(p) 0 |
// | sin(p) cos(p) 0 |
// | 0 0 1 |
//
// tilt matrix (rotation about y-axis)
// | cos(t) 0 sin(t) |
// | 0 1 0 |
// | -sin(t) 0 cos(t) |
//
// roll matrix (rotation about x-axis)
// | 1 0 0 |
// | 0 cos(r) -sin(r) |
// | 0 sin(r) cos(r) |
//
// roll * tilt * pan =
//
// | cos(t)*cos(p) cos(t)*-sin(p) sin(t) |
// | -sin(r)*-sin(t)*cos(p) + cos(r)*sin(p) -sin(r)*-sin(t)*-sin(p) + cos(r)*cos(p) -sin(r)*cos(t) |
// | cos(r)*-sin(t)*cos(p) + sin(r)*sin(p) cos(r)*-sin(t)*-sin(p) + sin(r)*cos(p) cos(r)*cos(t) |
//
// in case of gimbal lock (cos(t) = 0, sin(r) = 0, cos(r) = 1):
//
// | 0 0 sin(t) |
// | sin(p) cos(p) 0 |
// | -sin(t)*cos(p) -sin(t)*-sin(p) 0 |

void ent_setmatrix_rb(ENTITY *entity, float *m)
{
float pan, tilt, roll;

if(fabs(m[2]) > 0.9999) // looking straight up or down -> gimbal lock
{
draw_text("gimbal lock", 10, 10, vector(255,255,255));
pan = atan2f(-m[4], m[5]); // -m[4]?
tilt = 1.570796 * sign(m[2]);
roll = 0;
}
else
{
pan = atan2f(m[1], m[0]); // swap?
tilt = asinf(m[2]);
roll = atan2f(m[6], m[10]);
}

entity->pan = pan * RAD2DEG;
entity->tilt = tilt * RAD2DEG;
entity->roll = roll * RAD2DEG;

entity->x = m[12] * METERTOQUANT;
entity->y = m[13] * METERTOQUANT;
entity->z = m[14] * METERTOQUANT;
}



the conversion from 3dgs eulers to matrices (needed by newton) and back again. previously i had some problems with this which caused wrong orientation and jitters occasionally. now it seems to work flawlessly.

there isn't much missing now for posting the first simple working example.

Re: newton [Re: ventilator] #113060
05/19/07 10:28
05/19/07 10:28
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441

Page 2 of 16 1 2 3 4 15 16

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1