May 02, 2024, 01:02:18 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Needs and Desires

Started by J B Wood (Zumwalt), July 27, 2006, 07:50:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

Camera.LookAtID(MeshID)
Camera.Follow(MeshID)
Camera.Hover(x,y,z,MeshID) (where x,y,z are the distance from center of Mesh to point of hover, this can or should also include a follow)

Right now, Mesh has no way of telling me what its X,Y,Z are, so I can't build a custom structure to fill with the pointers of the locations, Camera doesn't accept a LookAt which is the pointer to the x,y,z of the mesh.

More to list later, going through trying to build a basic game.

J B Wood (Zumwalt)

July 27, 2006, 08:03:32 PM #1 Last Edit: July 27, 2006, 08:08:52 PM by zumwalt
You know what, nevermind, I got the location of an object in the scene, the textless helpfile is cryptic.

// local variable
VECTOR3 myMesh;

// define the target
myMesh = z.GetPosition(0); //Note the 0 means current world it appears, took mea while to guess this
//Add to DO loop
// render the information
s.RenderText(0,30,"X:"+NumToStr(myMesh.x),RGBA(255,255,0,255));
s.RenderText(0,40,"Y:"+NumToStr(myMesh.y),RGBA(255,255,0,255));
s.RenderText(0,50,"Z:"+NumToStr(myMesh.z),RGBA(255,255,0,255));

//Now look at our mesh:
c.LookAt(myMesh.x,myMesh.y,myMesh.z);




More to come as I eat M&M's and drink Mountain Dew!

Ionic Wind Support Team

This topic, a few below the one you created, would have helped ;)

http://www.ionicwind.com/forums/index.php?topic=760.0
Ionic Wind Support Team

Ionic Wind Support Team

Quote from: zumwalt on July 27, 2006, 08:03:32 PM
You know what, nevermind, I got the location of an object in the scene, the textless helpfile is cryptic.

Being an Alpha version docs are a bit scarse.  The Beta's will have more documentation.
Ionic Wind Support Team

J B Wood (Zumwalt)

July 27, 2006, 08:29:37 PM #4 Last Edit: July 27, 2006, 08:31:56 PM by zumwalt
Still fiddling with this thing, but getting farther, and my Demo's for 3d that are in my examples are only 3, and they are very basic, for me there useless, they don't show much at all.


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


Now I am going to get the camera to follow the mech, now that I am moving him around.
Notice how I am using .Position on the 3dobject instead of move that is like the camera pointer.
I don't know why these are not kept along the same naming convention, would be easier to understand.
The camera is always looking at the mech now, which is what I wanted, although it is not following it yet as of this post, but for 30 minutes of work and learning, not bad I don't think.

J B Wood (Zumwalt)

What do I need to do to the terrain to make it flat?
I don't know if its flipped or what...

m.Load3DS(s,GetStartPath() + "media\\zumwalt.3ds",true);
m.Scale(1,1,1);
m.Position(0,0,0);
m.Rotate(-22.5 * .01745,180 * .01745,0);
m.EnableLighting(true);
m.UseVertexColor(false);



Ionic Wind Support Team

Quote
they are very basic, for me there useless, they don't show much at all.

The other examples are posted here on these forums.  Give me a bit of a break please , it's only the initial test release of the engine and hasn't even been tested fully by me yet.

I recommend you wait a couple of more releases before trying to write the next commercial game with it. Since everything is subject to change before the beta's. 

Glad you're having fun with it though.

Ionic Wind Support Team

J B Wood (Zumwalt)

LOL :)
Come on Paul, I know its Alpha, I am not trying to write a commercial game with it, I am just trying to write a little demo game with what you got.
I haven't burled through the forums looking for zip files for other demo's, but I'll do that and see where they are hiding.
Just trying to help by showing off the engine some more.
Don't take offense to anything I write, when I get to programming things, I get very into what I am doing, literally.

I have a very unique personality.
Its like having multiple personalities, there is my programmers hat, my family hat, my friends hat, etc.
Anyway, I am praising your software all over the place, different boards, etc.

If you have any questions, you got my email.
Your my only source to answer some of the basic questions about what you have already in the alpha.
I am betting there are tons of undocumented methods (rather not even showing up) in the docs yet do to time. So, what I hope to pry out of you, is those hidden methods if it is something I need to finish my demo for you. Thats about it.

Ionic Wind Support Team

No offense taken ;)

I am just very busy at the moment.  So if I don't have an immediate answer it's not because I don't care, it's usually because I am involved in something else at the moment.  Like the debugger.
Ionic Wind Support Team

J B Wood (Zumwalt)

Heck man, no rush, seriously!
I am hoping that by me diving into the 3d engine as deep as I can, that maybe I can hash out or find little bugs here and there to let you know about.
I don't even expect you to really answer any of my questions if you don't want to, its nice but not necessary.
I am like a kid in a candy store, as if you couldn't tell.

J B Wood (Zumwalt)

Need class info for:
CDirectInput

Specifically, events, I need keypress for space event.
I have tried di.KeyPress, doesn't work.
I tried di.KeyDown(DIK_SPACE) but its not recognized, however I don't want an event for holding the space, just hitting it.
Does this exist yet?

J B Wood (Zumwalt)

Nevermind, still learning the rules to this thing:


s.BeginScene(c);
scene.Draw();

if di.KeyDown(DIK_SPACE)
{
s.RenderText(0,70,"Fired: Missle",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: Nothing",RGBA(255,255,0,255));
}


For render to work properly it must exist after the scene.draw() event.

J B Wood (Zumwalt)

This is why I need a KeyPress Event instead of KeyDown event :)

if di.KeyDown(DIK_PERIOD) & !di.KeyDown(DIK_COMMA)
{
s.RenderText(0,70,"Fired: Missle",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}

if di.KeyDown(DIK_PERIOD) & di.KeyDown(DIK_COMMA)
{
s.RenderText(0,70,"Fired: Ejection Seat",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}

if di.KeyDown(DIK_COMMA) & !di.KeyDown(DIK_PERIOD)
{
s.RenderText(0,70,"Fired: Machine Gun",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}


Ionic Wind Support Team

The DirectInput class is part of the 2D library.  Read the help file.
Ionic Wind Support Team

kryton9

Zumwalt, can you export one of the ikmodels in gamespace as directx. I tried all the ones in gamespace light, but they all had too many polygons and wouldn't allow me to save.

An easy one located in the object library is named flex. It is just an arm.

Move the frame numer to 15 in the animation control box and then click on the green bone sticking out at the tip of the hand.
Move that up to a 90 degree angle and the arm flexs.

Now move it frame 30 and lower the hand back down. A nice animation and if you can export it out to directx it will be a good test of its capabilities.
I am having no luck with 3d max. I used their pro done samples and tried every which way to export and just couldn't get it work.

So I tired gamespace light but the limit hampered the tests.

I am going to try something in anim8or if it suppots direct x next.

You should be able to open it up with my model viewer and it should work. If you see it moving too slow or too fast, you can adjust the animation speed with the f1 and f2 keys, also setting the rate higher might speed it up.

Thanks, hope it works.

If we have no luck, I will scrap the legs and put something else at the bottom of the mech: )

J B Wood (Zumwalt)

I'll do this later tonight. No time at the moment, but I'll follow your directions to a T.

kryton9

Thanks, I tried other programs last night and no luck, either no .x export or they didn't have animation capabilities.

Maybe the thing would be to make it something that can walk through code.

But since that means lots of work with the transforms, I am thinking of making a 3d object tool.

That will allow you to adjust transforms and other model settings visually and then it can save that info to a file or if I can pull it off, or generate a basic code template for you to run and see the model.

Will take some time, but I think be useful in the future. I need to figure out how to dynamicaly create unkown amounts of objects and variable names etc, sounds like I will need to live in pointer land to do all of that. Will be fun to work on.

J B Wood (Zumwalt)

Your thought process is on track for this. You have to store your main objects in a hashtable so you have there index. Its just easier that way to me. Then when you want to move a certain item, you adjust it via your customized coordinate system for that object. Its not going to be easy, I did this for a temple demo on 3Impact a while back where I loaded the temple into memory and just created new copies of the same object and placed them at there own coordinates.

It wasn't as complicated as what you are planning on doing, but its a general idea. I don't think that is something I would want to tackle this early in the game though.

kryton9

August 15, 2006, 11:54:18 AM #18 Last Edit: August 15, 2006, 11:57:03 AM by kryton9
I think just to have complete control over our models it is the only way. I get tired of going in and making changes to the code in the simple model viewer to try things out. It will be fun to work on and to learn more stuff about Aurora.ÂÃ,  Got me excited to work on it, so will tackle this next. I know if I can get it working it will be very beneficial.


The first mesh you load will be the main base object that everything else will be childed too. So the subsquent meshes will automatically be assigned a trans to be used in case needed.

For naming, here is what I am thinking. It will ask you to name the part as you load it, so lets say it is the Upper Right Leg, the user would enter UpperRightLeg.
The program will then create these variables when it generates the source code, internaly in the tool it will all be in arrays or in pointers(not sure yet), which do you think will be better naming or do you have any other ideas:

Long Naming Descriptions:
meshUpperRightLegPosition
meshUpperRightLegDirection
meshUpperRightLegLeftRight
meshUpperRightLegUpDown
meshUpperRightLegBackwardForward
meshUpperRightLegPitch
meshUpperRightLegYaw
meshUpperRightLegRoll

transUpperRightLegPosition
transUpperRightLegDirection
transUpperRightLegLeftRight
transUpperRightLegUpDown
transUpperRightLegBackwardForward
transUpperRightLegPitch
transUpperRightLegYaw
transUpperRightLegRoll

Short Naming Descriptions:
mUpperRightLegPos
mUpperRightLegDir
mUpperRightLegLR
mUpperRightLegUD
mUpperRightLegBF
mUpperRightLegP
mUpperRightLegY
mUpperRightLegR

tUpperRightLegPos
tUpperRightLegDir
tUpperRightLegLR
tUpperRightLegUD
tUpperRightLegBF
tUpperRightLegP
tUpperRightLegY
tUpperRightLegR


kryton9

August 15, 2006, 12:02:16 PM #19 Last Edit: August 15, 2006, 12:27:18 PM by kryton9
One more project idea is to write a class to handle movement like in a first person game, that is WASD moves the camera forward, backward, left and right. The mouse controls the direction of movement or looking. Spacebar is jump, Left CTRL is crouch, E is use, F is flash light, R is reload, left mouse fire, right mouse button alt fire, middle scroll cycle weapons/items.ÂÃ,  Of course the user can add more or not use what they don't need.

This might be something easier to start on before I do the tool. Would like any suggestions before I start on this or the 3d object tool.

edited: hmmm, thinking about it, the control... a function seems to make more sense and I don't see benefits to making it a class, if I am wrong let me know, thanks.

J B Wood (Zumwalt)

Do it as a class, then each model class can inherit from the propper movement class.
Less overhead I think, although I could be wrong. Can't do anything on any of this personally for another 3 hours.
Now I think I need to buy a small desk to put my scanner on and setup my CAD board, then break out the old 24x32 paper..

Find my T square and draw.

kryton9

Came home and am going to do some tests with the code for user movement. Should be fun tonight :)

kryton9

August 15, 2006, 11:52:20 PM #22 Last Edit: August 16, 2006, 12:45:24 AM by kryton9
I got the basics working for the fps control.

Need to smooth out the movement and adjust for a rotation that seems to crop up when using the mouse to look around while moving.

You will need to adjust the Path to your Media Folder located in Aurora's D3D Examples Folder

Once I get the kinks worked out and common keys implemented, will need help to make it a class. Still having a hard time seeing why this should be a class instead of a function :)

// fps control v1
// by kryton9
// 8/15/2006
// modding the Aurora Landscape Example for testing purposes

declare import,timeGetTime(),int;
declare import,ScreenToClient(hWnd as int, lpPoint2 as point),int;
declare import,GetCursorPos(lpPoint as point),int;
C3DCamera c;
C3DLandscape m;
C3DScreen *s;
CDirectInput *di;
float fadjust,fTarget;
point *mouse,*mousePrev;

global sub main()
{
s= new(C3DScreen,1);
C3DObject scene;
di = new(CDirectInput,1);
mouse = new(point,1);
mousePrev = new(point,1);
//target 60FPS for camera movement
fTarget = 1.0f / /*FPS*/60.0f * 1000.0f;
fAdjust = 1.0f;

s->CreateWindowed(0,0,800,600,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE|AWS_CENTERED,0,"FPS Controls Test - ESC exits",NULL,false);
di->Init(s);
c.Create(s);
c.Position(0,0,-8);
c.Orient(0,0,1,0,1,0);
c.SetBackPlane(10000);

s->Clear(RGBA(0,0,0,255));
s->BeginScene(c);
s->RenderText(0,10,"Loading objects...",RGBA(255,255,0,255));
s->RenderScene();

// Setup the landscape properties
float blockSizeX = 2.0f; /* Size of each block of land along x axis */
float blockSizeZ = 2.0f; /* Size of each block of land along z axis */
float maximumLandHeight = 50.0f; /* Tell the program what value 255 of height map color corresponds toÂÃ,  */
float landTextureScaleX = .2f; /* Texture scaling along x axis, fraction along the width of the texture per block of land */
float landTextureScaleZ = .2f; /* Texture scaling along z axis, fraction along the height of the texture per block of land */
int grayScaleLightMap = true;ÂÃ,  /* Whether light map is gray scale or color, in this case, it's gray scale light map */
//load the landscape.
string mediaPath = GetStartPath() + "..\\media\\";//<<<<<<<<<<<<<<<< Need adjust to match your media folder for Aurora's D3D Examples

ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  m.Load(s,mediaPath + "map.bmp",mediaPath + "lightmap.tga",mediaPath + "coverage.bmp",
mediaPath + "tile1.tga",mediaPath + "tile2.tga",mediaPath + "tile3.tga",
blockSizeX, blockSizeZ, maximumLandHeight, landTextureScaleX, landTextureScaleZ, grayScaleLightMap);
m.Position(-256,25,512);
m.EnableLighting(false);
m.InitCollision(false);

scene.CreateScene(s);
scene.AddChild(m);
int fps = 0;
int startTime;
do
{
startTime = timeGetTime();
fps();//ÂÃ,  ÂÃ,  ÂÃ, first person control function <<<<<<<<<<<<<<<<<<<<<<
s->Clear(RGBA(0,0,0,255));
s->BeginScene(c);
scene.Draw();
s->RenderText(0,10,"FPS:"+NumToStr(fps),RGBA(255,255,0,255));
s->RenderText(0,30,"x: "+NumToStr(mouse->x)+"ÂÃ,  y: "+NumToStr(mouse->y)+"ÂÃ,  m_pos.x: "+
NumToStr(s->m_pos.x)+"ÂÃ,  m_pos.y: "+NumToStr(s->m_pos.y),rgba(255,200,0,255));
fps = s->RenderScene();
fAdjust = (timeGetTime() - startTime) / fTarget;
}until di->KeyDown(DIK_ESCAPE);
Scene.Free();
delete di;delete s;delete mouse;delete mousePrev;
}

sub fps()
{

getCursorPos(*mouse); // This gives mouse x and y referenced for the whole monitor
//ScreenToClient(s->m_hWnd, *mouse); Not needed for nowÂÃ, 

if di->KeyDown(DIK_W) c.Move (0.0f,0.1f * fAdjust);

if di->KeyDown(DIK_S) c.Move (0.0f,-0.1f * fAdjust);

if di->KeyDown(DIK_D) c.Move (5*.01745 * fAdjust,0.0f);//ÂÃ,  ÂÃ, 

if di->KeyDown(DIK_A) c.Move (-5*.01745 * fAdjust,0.0f);

//if di->KeyDown(DIK_F) Flash light

//if di->KeyDown(DIK_E) ÂÃ,  Use key

//if di->KeyDown(DIK_LCONTROL) Crouch

//if di->KeyDown(DIK_SPACE) Jump

if mouse->x != mousePrev->x
{
if mouse->x < mousePrev->x
{
c.Rotate(-1* 0.05 * fAdjust,0,0);
}
else c.Rotate(1* 0.05 * fAdjust,0,0);
}
mousePrev->x = mouse->x;

if mouse->y != mousePrev->y
{
if mouse->y < mousePrev->y
{
c.Rotate(0,-1* 0.05 * fAdjust,0);
}
else c.Rotate(0,1* 0.05 * fAdjust,0);
}
mousePrev->y = mouse->y;

}

J B Wood (Zumwalt)

I passed out lastnight after doing homework, literally.
So nothing got done.

I got home from work, sat down, did 2 discusion threads, laid down for a nap, and the alarm work me at 6am.
*sigh* I missed dinner..

Ionic Wind Support Team

Not sure if it relates to your experiment but...Use the camera method LockYAxis for FPS style cameras.  Which allows you to 'look around' without affecting the Y axis for movements.  Probably has more use for indoor scenes.
Ionic Wind Support Team