April 24, 2024, 05:57:05 AM

News:

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


Zumwalts Blast A Mech Code

Started by J B Wood (Zumwalt), July 29, 2006, 07:20:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kryton9

I was loading the wrong file, I like the new lighting. really adds ambiance!!

Where did you read about the new commands and how to use them, maybe my Beta install didnt put the new help in?

J B Wood (Zumwalt)

I just use the class view, then I look for the C3DOjbect class and see what it takes.
The problem is, my numbers adjust like they should but the mgun doesn't reset on each loop like it should.
For now, I am pointing the finger at me saying I am forgetting something in my call.

Small section of the code, its easy to figure out where I put this stuff.



float tX=0.0;
float tY=0.0;
float tZ=0.0;

do
{
transpos = trans.getposition(0);
mechPOS = m1.getPosition(0);

tX=(mechPos.x-transpos.x);
tY=(mechPos.y-transpos.y);
tZ=(mechPos.z-transpos.z);
trans.lookat(tX,0,tZ);

s.Clear(RGBA(0,0,0,255));
s.BeginScene(c);
scene.Draw();



The machine gun points at target correctly, but doesn't move, when I move it stays stationary, when I rotate the turret, it stays on its turret location but doesn't point to target, when it is obviously in the loop, and I am getting a new tX,tY,tZ on every loop from the new calculations, they do change, but the lookat is acting like it is ignoring them.

kryton9

I was playing with the LookAt command all last night with my axis and points sample. I tried The lookat with everything available and couldn't get it to point correctly. It did point and would redirect when at different positions. I will look at it more tonight, but it seems like the Y direction is not working correctly. I can't ever get it to look to negative Y space.

Z and X look in both the positive and negative spaces, but not y. But still confused enough that I am going to clean up the code and just making everything a simple option to see all the different code and how it reacts. Instead of commenting and uncommenting stuff each time as I was last night.

I will write more about it tomorrow, I didn't mention anything because I thought I would let Paul finish his documentation and then see if I was doing something wrong.

kryton9

I also like the loading update while it loads all the various parts, nice touch.

Fun driving around with those cool looking trees. Great job so far!!

J B Wood (Zumwalt)

Thanks.
At some point soon I am going to create a collision model so its not just the tank body mesh vs the terrain, it will be bouding spheres.
Alot to do.. alot to do..

kryton9

That is alot to do. Just take your time.

I was just looking through some of the include files in Saperos stuff. There is tons of cool stuff with vectors and such.
There are tons of directx and directx10 includes with cool info.

Might save you from having to do your own routines for v3 and v2,

J B Wood (Zumwalt)


kryton9

The includes have lots of functions, just to see how this stuff works. tons to look at in there. Sapero did an incredible amount of work. No wonder he can do so much and cool things.

I feel like a kid who discovered a secret toy room looking through it all. Now if I can figure out how to use any of it :)

Ionic Wind Support Team

I read somewhere that you can install dx10 on XP.  Just not officially.

Anyway you have to remember that the LookAt method affects the matrix, just like rotating affects the matrix.   So if you look at a point and then rotate you will be chaning the 'lookat' point.

The initial look at orientation is 0,0,1 normalized.  Which means it is looking at a point down the z axis into the screen.  Keep that in mind when creating your meshes.  If you create a character who's face is 0,0,-1 then the look at point is 180 degrees rotated.

Ionic Wind Support Team

J B Wood (Zumwalt)

Thats not the problem, not on mine.
My gun faces the mech correctly on the first pass of the do loop.
Each consecutive pass makes no changes to the guns facing.
So how do I make the gun do a lookat command and work?

...
...
...
Hold the phone a sec... I think I just figured out my problem.
Don't have a solution at the moment but it definately is the problem.

Lookat works, meaning that the point I am looking at is static, but the point I am looking FROM is not static.
So LookAt is pointing to a definate coordinate of x,y,z which doesn't change since the object doesn't move.

As I move my tank, point of origin being the gun is looking at the mech of x,y,z position, but the gun itself is moving.
LookAt in this instance is always getting the static of the x,y,z of the mech but it is not taking into consideration the guns position as it relates to the target being the mech.

Whats the guts of that code Paul? (lookat command code)

J B Wood (Zumwalt)

I am uploading new build now with a new command in V3 for finding the mid point between 2 3d points.
I have added to the code for demonstration purposes, a red sphere that sits on that mid point.
That mid point is what the LookAt command looks at, which shows the fact I am sending LookAt a new coordinate on every pass of the do loop.
I think this is boiling down to the facing of the object from the LookAt command, I assume there is math in the LookAt that determines between the source object and the destination object, the facing it needs to use.

What it doesn't take into consideration, is the current facing of the source object, to rotate it to a new facing based on a new coordinate passed into it after the first iteration of the routine.

J B Wood (Zumwalt)

Update build now has the target fixed because PAUL ROCKS!!!
The machine gun always targets the dummy mech (not krytons at the moment)
Now to figure out layered 2d screens on the 3d screen.
That will be some interesting code.

kryton9

September 03, 2006, 10:59:56 PM #62 Last Edit: September 03, 2006, 11:04:33 PM by kryton9
Why not use Sprites instead of layered 2d screens? Didn't know you could even layer 2d on top of a 3d screen.

Just downloaded the latest version, that is really neat to see that machine gun target like that. Great job Zumwalt, keep up the great work.

J B Wood (Zumwalt)

Thank Paul for the LookAt command, without it I would probably be months fiddling with it.

J B Wood (Zumwalt)

Paul can you please sticky this thread?
Kryton I have updated the game with your mechanical monster, needless to say the tank gets chased now, however I left the speed of the beast alone.
I made some slight changes to the code to adjust for the chase, including the continual lookat update.
Take a look at the new game.
Its really coming together.
Now to figure out how to speed up the chaser :)

Ionic Wind Support Team

How is the game going?  Let me know if there is anything specifics, besides physics ;)  that you need for the next update.  I have some time for coding this week and am looking for things to do.
Ionic Wind Support Team

Kale

October 02, 2006, 12:57:52 AM #66 Last Edit: October 02, 2006, 08:11:52 AM by Kale
Quote from: Paul Turley on October 01, 2006, 09:35:23 PM
How is the game going?ÂÃ,  Let me know if there is anything specifics, besides physics ;)ÂÃ,  that you need for the next update.ÂÃ,  I have some time for coding this week and am looking for things to do.

Sound Support. (mp3, ogg, wav, etc...) ;D
Billboards and Particles for the 3D engine too. :)

J B Wood (Zumwalt)

I have been concentrating on physics, mainly trying to intigrate PhysX into the system.
Which might not be possible, but like Kale mentioned, sound and particles would be a plus.
I'll write more tonight when I get home, I now have a dedicated programming machine at the house for nothing but Aurora.

I will definately need your help with Rakknet integration Paul.

Shannara

Sweet, how much did that PhysX card cost you? I've been looking to buy one locally, but have been unable to do so. I may need to buy one online.
Love is staying up all night with a sick child, or a healthy adult.

J B Wood (Zumwalt)

Those cards cost from around $300 on.
I have been dealing mainly with the software side because the cards cost.

Shannara

Oo, the ones from Ageia Technologies?
Love is staying up all night with a sick child, or a healthy adult.

J B Wood (Zumwalt)

Yup those are the ones. Aegia has a very cool physics engine, I got me a copy to use in freeware, fun to play with, haven't emplimented it in Aurora yet, been learning the API

J B Wood (Zumwalt)

I just fixed the main link to the download, however, do to a server crash and file purge that I had to find the latest stable release I had at hand, when I get home tonight, I will tear through 3 other machines to find the latest version since this one is missing the Kryton Mesh in it. However, the downloadable version has the code, images, everything that was used to build the alpha version.

Plus there are tons of odds and ends files in the project folder.
Including the core to Newton that I wrote.