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 / Camera command something i don't get.

Author
Message
Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 14th Mar 2006 22:31 Edited at: 14th Mar 2006 22:43
Ok when i use this code:



I cant see the box.

I'm thinking i positioned the box at X (1) Y (1) Z (1)
So i position the camera 10 Behind the box object. So it is 10 further than the object. When i execute my code i can't see the box.

I'm using DBP. I know there is a command Point camera but i'm just wondering. How can i do this without the Point camera Command.

EDIT: When i set z to - 10 i can see the object i thought the wrong way i needed to make z lesser (farther away) from the object.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Mar 2006 04:17
I think you've confused your axises. The X axis moves from left to right, the y axis moves from up to down, and the z axis is forwards and bakwards. So, if you wanted to position the camera 10 units behind the object, you'd use this:

POSITION CAMERA 0,0,-10

What you're doing is positioning it 10 units higher than the object, so you wont see it. In order to see it when you're ten units above the object, you'll either have to A. Fidn the necassary angle to be able to rotate the camera to look at the object (fairly hard though I made a function to do this, I might release it tomorrow), or B. use point object.

Why dont you want to use point object? From what I've seen it doesnt cause much lag.

Also, if you just want to see your object then dont move the camera anywhere and leave AUTOCAM ON. And theres no reason to put the POSITION CAMERA command in the loop unless the positions are changing, so take it out (put it above) and use the AUTOCAM OFF command above the POSITION CAMERA command.

Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 15th Mar 2006 08:02 Edited at: 15th Mar 2006 08:02
So if i would change the code when you pres up and down the camera goes up and down. When in the same loop (or funtion) is autocam on. Then the camera automaticly sets it behind the object.

It's not that i don't want to use the point cam i was just wondering. I'm stil learning DBP and i just wanted to know this

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Mar 2006 12:38 Edited at: 15th Mar 2006 12:41
<EDIT>

Didnt understand your question at first. No no, what AUTOCAM does is it automatically repositions/rotates the camera to be able to see any new objects created. So if you were to make a new object inside the loop, then the camera would reposition itself it AUTOCAM is on. This is usually not what most programmers want as they would rather control the camera themselves to get the desired effect, so to do this you just throw an AUTOCAM OFF command at the top of your code and you'll be set. Look it up in the help files for more info'.

</EDIT>

If you want to change the camera positioning during the loop, (so moving it uo with the upkey and down with the downkey) you would put the camera command in the loop along with the appropriate checks. Here's a simple program that'll get you started with the camera commands:



Controls:

Arrow Keys Pan the Camera Up, Left, Down, Right. WSAD Rotates camera up down left right. Pressing 1 will turn manual mode on (default) which allows you to control the camera by using the above keys, pressing 2 turns automatic mode on disallowing you to control the camera and positioning the camera/pointing the camera at a preset location.

Play with the code, the camera commands aren't that hard to get used to. Very similar to the object commands.

Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 15th Mar 2006 14:33 Edited at: 15th Mar 2006 14:50
Thanks the only thing i don't understand from the code is the WRAPVALUE command (cant look in the help files because i'm not at home right now.)

Edit: Found that the wrapvalue command is for not exiting 360 ° of rotation when it is more then 360° then this command make it 1°.

Thanks for the help.

Login to post a reply

Server time is: 2024-11-27 23:40:10
Your offset time is: 2024-11-27 23:40:10