May 05, 2024, 10:19:55 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Discovered Bugs

Started by J B Wood (Zumwalt), July 28, 2006, 11:29:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

(Probably not a bug, probably as designed but a good to know)
c.Position(1,1,1); = Looks straight down on coordinate to target match of c.LookAt(myTerrain.x,myTerrain.y,myTerrain.z);
c.Position(0,0,0); = Looks straight down on coordinate to target match of c.LookAt(myTerrain.x,myTerrain.y,myTerrain.z);
c.Position(-1,-1,-1); = Looks straight up on coordinate to target match of c.LookAt(myTerrain.x,myTerrain.y,myTerrain.z);


Will add more info as I find more info.

J B Wood (Zumwalt)

July 28, 2006, 01:28:18 PM #1 Last Edit: July 28, 2006, 01:51:03 PM by zumwalt
C3DOBJECT::ROTATE issues, only triggers 1 time for some reason.


IF di.KeyDown(DIK_RIGHT)
{
//z.Position(myMesh.x+.25 * fAdjust,myMesh.y+0.0f,myMesh.z+0.0f);
z.Rotate(0.0f,0.25 * fAdjust,0.0f);
}
IF di.KeyDown(DIK_LEFT)
{
//z.Position(myMesh.x-.25 * fAdjust,myMesh.y+0.0f,myMesh.z+0.0f);
z.Rotate(0.0f,-0.25 * fAdjust,0.0f);
}


Mech makes a single turn either .25 to left or right, but won't continue in a circle, almost as if that rotate is max it can go, to .25 in either direction from center.

This is definately a problem, I tried using the Camera's example for its rotate, and have the same issue of rotate glitch:


IF di.KeyDown(DIK_RIGHT)
{
//z.Position(myMesh.x+.25 * fAdjust,myMesh.y+0.0f,myMesh.z+0.0f);
z.Rotate(0,1 *.01745 * fAdjust,0);
}
IF di.KeyDown(DIK_LEFT)
{
//z.Position(myMesh.x-.25 * fAdjust,myMesh.y+0.0f,myMesh.z+0.0f);
z.Rotate(0,-1 *.01745 * fAdjust,0);
}


It moves just 1 notch to either side of center and refuses to go further.

Ionic Wind Support Team

Rotate is an angle.  Not a movement.  Add to a rotation number for each step.  Unlike the old retained mode DX7 where you could add to the rotation each frame.

Ionic Wind Support Team

Ionic Wind Support Team

You can also use the Orient method to set the orientation of a mesh in any direction of 3D space.  Just by specifying the direction and up vectors.

Ionic Wind Support Team

J B Wood (Zumwalt)

Thanks, I'll play around with both tonight, I don't understand the first suggest with the step, but I'll probably figure out something. I need to place the camera behind the mech mesh, and do some other stuff, slowly coming along, finding me a good missile set to shoot and stuff, still basic stuff, very basic, but I am getting the hang of it in this engine.

Ionic Wind Support Team

float angle = 0.0;

.....
do
{
.....

if( di.KeyDown(DIK_RIGHT))
{
        angle += .025;
}
IF di.KeyDown(DIK_LEFT)
{
       angle -= .025;
}

z.Rotate(0.0f, angle * fAdjust,0.0f);

....

Understand now?
Ionic Wind Support Team

J B Wood (Zumwalt)

Understand, but I get a wierd problem when using it, its easier for you to see than for me to explain.
Latest Build:

Ionic Wind Support Team

actually it should have been

angle *.01745 * fAdhust

Since all DirectX angles are in radians ;)
Ionic Wind Support Team

kryton9

July 29, 2006, 12:03:41 PM #8 Last Edit: July 29, 2006, 12:16:38 PM by kryton9
This is working for me and what I am using in the model viewer I am writing:

IF di.KeyDown(DIK_UP) // pitch object up
{
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  k9fMpitch+=0.01;
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  m.Rotate(k9fMPitch,0,0);
}


When I have all the keys set it will be like:

IF di.KeyDown(DIK_UP) // pitch object up
{
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  k9fMpitch+=0.01;
}
IF di.KeyDown(DIK_LEFT) // turn object left (yaw)
{
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  k9fMyaw+=0.01;
}
.
.
.
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  m.Rotate(k9fMpitch,k9fyaw,k9fMroll);


variable syntax notes:
k9 is what I use when adding to existing code written by someone else
f is for float
M is the mesh object

J B Wood (Zumwalt)

July 29, 2006, 12:22:04 PM #9 Last Edit: July 29, 2006, 12:25:09 PM by zumwalt
Hrm, I still can't seem to point this out very well, I get a "JITTERING" effect when the mech is rotated.
Like I said, unless you download the code and try it, even with the
z.Rotate(0.0f, angle *.01745 * fAdjust,0.0f);

It does a jittering back and forth the further in the movement you go.
I'll look for some sort of screen recording software and post a mpeg or something of the problem, maybe that will help.

edit:
Nevermind, this adjustment got rid of the jitter.


if( di.KeyDown(DIK_RIGHT))
{
angle += .025 * fAdjust;
}
IF di.KeyDown(DIK_LEFT)
{
angle -= .025 * fAdjust;
}
z.Rotate(0.0f, angle,0.0f);

J B Wood (Zumwalt)

Everything's color is way off, what do I have to do to the light to give it accurate color?
Is that something I have to do with the mesh itself?

J B Wood (Zumwalt)

3DS can't collide with X meshes.
X Meshes with no textures applied take another X texture as there own, in this example, I have added another Mech, made to an X file, its taking the texture of the sprite.x instead of being pure white.
I have enabled collision checking on the mesh, but it collision is not returning true when mech 1 hits mech 2.

Latest build with all media included.

Ionic Wind Support Team

Collision only works with standard X meshes. 

There is no object to object collision support for skinned X currently, except sphere and ray.  The skinned X mesh is stored differently than normal meshes, using individual bone matrices with each having it's own geometry set, making it quite difficult to integrate with the Opcode collision library. Skinned X support is very basic.

Have you considered using MD2 meshes for your mechs?  Better support for animation and collision as the meshes are stored in frames and interpolate between odd times for very smooth animation. 

I will also add MD3 support soon. 

Quote
Everything's color is way off, what do I have to do to the light to give it accurate color?

Download the docs for the DX9 SDK and read up on lighting.  Turn your ambient down, increase the diffuse if you need to, and if your using colored vertexes, and not textures, make sure you call:

mesh->UseVertexColor(true);
mesh->EnableLighting(true);
Ionic Wind Support Team

J B Wood (Zumwalt)

Will do, I'll try all of that.
Still building the alpha demo for the alpha release :)
I am not pushing it with the demo or the engine, just trying to figure it all out.