Page 2 of 2

Posted: Wed Feb 17, 2010 12:10 pm
by Kjell
Hi Umbrella,

Looks like you're trying to do something First-Person, right? Have a look at this thread.

Concerning a crosshair, as strange as it sounds .. the RenderText component is the easiest solution. I've attached a example.

Just let us know when you encounter any problems :)

K

Posted: Wed Feb 17, 2010 2:28 pm
by Umbrella
Hi Kjell,
I've already looked up several threads including the one you have posted and worked with them for a while; jph's FPS-Engine was quite helpful, but I actually wanted to create something like a flight-sim with reversed mouse-axises and without camera limitations. While it was easy enough to remove the limitations, the camera started behaving a bit weird, so I worked with the CenterMouse-example I found in the thread I've linked above.

After downloading your crosshair-example I first tried to start it in order to find out what it does before digging in into the actual project, but the Grid-model caused some errors.

Code: Select all

//

this.V.X *= 64;
this.V.Y *= 64;

//

this.TexCoord.X *= 16;
this.TexCoord.Y *= 16;
The program did not recognise the "this" so I first replaced it with CurrentModel and such, but since it still didn't work I just commented it and launched the example.

The crosshair and the camera-controls were done nicely, but is it on purpose that the camera always moves upwards until it hits the limitation? I guess it's because I've messed with the code a bit or something.
The example is quite similiar to Jph's FPS-engine and while I'll probably use both as references while working on my project I'd rather stick with my current solution which has something close to the vertically reversed, limitless camera-controls I'm looking for, but, same as in all first-person examples I've been working with yet, the horizontal camera-controls get reversed after moving the camera to the "bottom" as well.

Sorry, that probably doesn't tell you a lot, so I'm again attaching the project with this post, in case I have made any significant changes.

Anyway, while rendering text works splendidly, the actual model still doesn't change it's rotation or position according to the mouse, and I wanted the player model to move towards it via the SteeringController, but it currently remains in a fixed position.
And again, please be patient with me :)

Posted: Wed Feb 17, 2010 2:36 pm
by Kjell
Hello,

You're probably using a older version of ZGE ( get a Beta release here ) .. the TexCoord property for meshes only got added recently.

The reason I limited / clamped the vertical axis is because that's generally the behavior you want in first-person shooters ( Call of Duty / Halo / Killzone etc. ) .. but you're obviously trying to do something else.

Anyway, you picked the single most difficult game to pull off in ZGE :P For a flight sim camera / model system that can roll / pitch / yaw freely in 3D, you need to use Quaternions. I tried writing a ZLibrary for this some time ago, but failed to get it to work properly.

Sorry :?

K

*Edit - Typo

Posted: Wed Feb 17, 2010 3:16 pm
by Umbrella
Well, isn't that a pity.

Oh well, I'll try to find something else and might do some other project in ZGE in the future.
Anyway, thank you all for your help! :D
ZGE is a really great thing and I hope it will be continued!