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 / change direction camera is looking at start up

Author
Message
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 20th Jan 2008 19:55 Edited at: 22nd Jan 2008 17:00
I first "Load Static Objects" which is an imported FPSC DBO map file. I then position the camera within this "Universe" or "Level" where I want the player to start. I am also using mouselook for an FP perspective.

Here is the code which all works fine.



When I begin the player is facing the wall. I would like the player (camera) to be looking in the opposite direction (away from the wall). How do I accomplish this seemingly simple correction? I have tried 14 different camera commands starting with "Point Camera" and then the "Rotate Camera" and the individual "X,Y,ZRotate Camera" None seems to work. At least the variations I have tried have not worked. I either am doing something wrong, or, it can't be done (I've ruled that out only because of the FPSC player marker), or I have not found the correct command or commands to do this.

As opposed to Highlander.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Jan 2008 01:22
It should be a simple case of Rotate Camera 0,180,0.

Make sure you are using AutoCam Off as well and it shouldn't alter from the default 0,0,0 at the start.

TDK_Man

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Jan 2008 03:38 Edited at: 21st Jan 2008 03:41
Hey TDK,

That's what I thought at first. Only thing I didn't have coded was autocam off. I tried several variations of the "Rotate Camera" command as well as the "YRotate Camera." Among the combinations was 0,180,0 but even other combinations didn't change anything, i.e. where the camera is facing. I tried this all over again with autocam off but I'm afraid that didn't help either.

Exactly what do you mean by "and it shouldn't alter from the default 0,0,0 at the start"? Sorry for my ignorance and thickness of head.

Do you suppose this has something to do with the fact that I am working within an FPSC DBO universe? If so I wonder how many other problems I might run into along the way! Maybe I should forgo using static object loading of FPSC DBO's and create the level the hard way. I was kind of excited about this possibility since I had gotten used to painting maps with the FPSC map editor.

As opposed to Highlander.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Jan 2008 04:58 Edited at: 21st Jan 2008 04:59
I think I will forgo this problem for now and see if I can figure out how not to go through the outside walls and the stairs. Also, I hope I can figure out how to walk up the stairs. They were a part of the DBO. There's an upper room.

BTW, I tried putting the "rotate camera" in the main loop after the "position camera". Yes, that rotated the camera so that I was looking in the opposite direction. But then I was looking out the back of my head as pressing the up arrow key moved me backwards and the down arrow key moved me forward. Also, that played havoc with my mouselook. So that is not an option. I also tried to put an initial camera position with the rotate camera code after it just before entering into the main loop. However, apparently the code I have in the main loop caused it to turn around again.

As opposed to Highlander.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Jan 2008 06:04
Quote: "Exactly what do you mean by "and it shouldn't alter from the default 0,0,0 at the start"?"


When the camera is created in a 3D world, it is positioned at 0,0,0 and is un-rotated, (X, Y and Z angles are all set to 0).

So, if you use AutoCam Off and don't use any cam rotating commands then the camera should automatically be looking 'North' - even if you position it somewhere other than 0,0,0.

Quote: "I also tried to put an initial camera position with the rotate camera code after it just before entering into the main loop. However, apparently the code I have in the main loop caused it to turn around again."


That's where it should be. Try something like this in your main loop:



But if that doesn't work, (and I'm not familiar with loading an FPSC DBO universe), if the camera is initially facing the wrong way, logically thinking, I'd look for a way to maybe rotate the universe rather than the camera. Is that possible?

TDK_Man

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 22nd Jan 2008 16:58
TDK, I really appreciate your taking the time on this and thanks for the additional info. I had probably read that somewhere but I think I'm getting too old for this. But, I'm still having fun and it keeps my brain functioning.

Firstly, the camera is facing "North". I just wanted to turn it around 180 degrees after the camera position is initially placed so that I can be facing South. Can't get it to work so I think I will just have to create the beginning of the level to take into account how the camera will initially be placed and go from there.

I used BatVink's tutorial on loading the FPSC universe DBO. I have also used his example of the "static raycast" command to find the outer walls whether I'm to the front, back, left, or right. I am using a box object at the camera position to project these raycasts. These commands seem to not be documented and are not a part of the help file. They must be used by FPSC.

BatVink, is there a list of these commands somewhere? Are they are a part of what is called the "Enhancements.DLL?"

For those who are interested I updated my code to show how to keep from going through the walls created by the DBO.

A question for either moderator, TDK or BatVink: Can I provide a copy of my DBO and the two or three texture files that came from Dark Egypt? Or would that be a copyright infringement? Just thought this might be of interest to others.

As opposed to Highlander.

Login to post a reply

Server time is: 2024-09-27 10:36:10
Your offset time is: 2024-09-27 10:36:10