Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / First person options...

Author
Message
culmor30
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 27th Jul 2007 06:12
Soo... I've used Blitz3d for a long time, but I'm tired of it and I bought DBpro and DarkAI and DarkPhysics. I've been using them all for some time now, and I was thinking of making an FPS base. You know, simple stuff that I can build off of later.

So, I want my camera inside an object. How do I get it to follow the object's movement and y-axis angle? Whenever I try this the camera doesn't turn properly, and sometimes when I THINK it's working, the entire screen is black. How do I fix this? I tried hiding the object but that didn't really work... and if an object/camera combo isn't the best idea, what should I use?

And I don't really have any code to show, just looking for some ideas.

Thanks much in advance!
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 27th Jul 2007 08:59 Edited at: 27th Jul 2007 09:00
This should do what you're describing:

POSITION CAMERA Camera, OBJECT POSITION X(Object), OBJECT POSITION Y(Object), OBJECT POSITION Z(Object)
ROTATE CAMERA Camera, CAMERA ANGLE X(Camera), OBJECT ANGLE Y(Object), CAMERA ANGLE Z(Camera)

Issue these commands after the object has been positioned and rotated.

- Jane
culmor30
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 27th Jul 2007 09:03 Edited at: 27th Jul 2007 09:04
Ahh, thanks. I had exactly that, but I didn't know the rotate command so I tried to use position twice... and... didn't work quite right.

So, other question, how would I go about having a camera inside a primitive... say... cube, so I could still see the outside world but maybe in the future, other players could see the cube? I'd want to use sparky's for environmental collisions with that camera object.

EDIT: Within probably a day I'll have a base script to show, but I'ma sleep now.
culmor30
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 27th Jul 2007 19:27
Okay. So. Here's this so far. level.x is a simple flat terrain.



My problem is, whenever I press any of WASD, which are correctly mapped, sometimes the game screen flickers and all the controls are reversed? I had this problem once before but I don't remember if I ever fixed it. Anyone know how?
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 27th Jul 2007 21:03
Quote: "So, other question, how would I go about having a camera inside a primitive... say... cube, so I could still see the outside world but maybe in the future, other players could see the cube?"


You shouldn't have to issue this command:

SET OBJECT CULL Object, 0

...because this should be the default state, but if you do need to, there it is.

When the polys of an object are being culled, the "back" of the polys aren't drawn. The "front" of the polys are drawn. When the camera is inside the object, the backs of the polys are facing the camera and therefore won't be visible. An outside observer will be seeing the fronts of the polys, so the object will be visible to him/her.

In short, the system's pretty much already set up to do what you want.

- Jane
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 27th Jul 2007 21:34 Edited at: 27th Jul 2007 21:35
Quote: "How do I get it to follow the object's movement and y-axis angle?"


The problem with the reversing controls is my fault. I answered your question too narrowly with regard to exactly what it was that you asked. You need to use the following:

ROTATE CAMERA Camera, OBJECT ANGLE X(Object), OBJECT ANGLE Y(Object), OBJECT ANGLE Z(Object)

I’m working on the flicker.

- Jane
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 27th Jul 2007 22:04
Here you go:



The flicker was being caused by the cube being reoriented momentarily (Don't ask me why). Rotating the cube like this will stop that from happening.

Have fun!

- Jane
culmor30
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 27th Jul 2007 23:55 Edited at: 28th Jul 2007 00:24
Thanks again

Do you have any experience with sparky's? I have darkphysics but I just need to do some simple collisions, like ramps and level objects, plus gravity. If you can help, please do!

EDIT: Scratch the sparky's, instead, could you help with the character controller in dp? I know it's supposed to be terrible and such but for my purposes it will be fine.
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 28th Jul 2007 01:16
I had to do a Forum search for "character controler" because I've never heard of it. Since all but one of the posts was on the Dark Physics/Dark AI board, I guess it's a feature of one of those products. I don't use either of them at this time, so I can't help you with that.

Maybe you could make a new thread on that board. I'm sure someone can help you.

- Jane
culmor30
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 28th Jul 2007 01:18
Aight, thanks again for all your help!

Login to post a reply

Server time is: 2024-11-25 13:45:04
Your offset time is: 2024-11-25 13:45:04