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 / Problem positioning Camera

Author
Message
DarkNub
14
Years of Service
User Offline
Joined: 8th Dec 2009
Location:
Posted: 13th Dec 2009 22:00
Okay, my camera is throwing up massive problems. I have 5 Objects on screen, and the camera should be positioned on the 3rd one. Logically, I'd expext this to show, all the models. However, it's just throwing up nothing. Anyone able to look over this code please? (It's only a test scenario right now, I'm just trying to sort the camera)

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 13th Dec 2009 22:48 Edited at: 13th Dec 2009 22:53
1) use autocam off to take control of the camera. otherwise, the (default) autocam will focus on the last object loaded/created.

2) your make camera 1 call is actually creating a 2nd camera as camera 0 already exists. i don't think you realize this. a second camera doesn't appear necessary here. (you've also created a second light as light 0 already exists, btw)

3) while you may have positioned the camera near your intended target (object 3), you should follow it with point camera. since you postioned object 3 with:

POSITION OBJECT 3, 300,0,0

and want your camera positioned:

POSITION CAMERA 1,100,300,100

you would still want to:

point camera 300.0,0.0,0.0 `(your object 3's position)

to make sure the camera is pointing directly at object 3. this still won't show all the objects/models as you expect because:

1) you've placed the camera inside object 1 (based on your code)

2) it looks like you've got the camera placed too close to the "middle" object to ensure the other objects would actually be in view.

anyway, that's somewhere for you to start. take a look at all the camera (and light) help files for more info and begin experimenting. you'll get the hang of it pretty quick.

good luck!

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
DarkNub
14
Years of Service
User Offline
Joined: 8th Dec 2009
Location:
Posted: 14th Dec 2009 19:46
Aah thanks, that's been a massive help and I think I've figured out what I need to do now. However, I can't see a problem with the code but it's still throwing up an undefined parser error, not entirely sure why.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Dec 2009 22:32
Although unlikely the direct cause of your current problem I strongly suggest that you create folders for your projects and have a 'Models' folder inside each one (where required).

You can then replace:

LOAD OBJECT "C:\Users\User\Documents\ZOMBIE 3d SIDE SCROLLER\Models\zombiesurgeon.X", 5

with...

LOAD OBJECT "Models\zombiesurgeon.X",5

You might have problems later when you move your final exe to a new location if you use hard-coded paths.

TDK

DarkNub
14
Years of Service
User Offline
Joined: 8th Dec 2009
Location:
Posted: 14th Dec 2009 23:34
Aah, I do have it almost like that.

Inside "C:\Users\User\Documents\ZOMBIE 3d SIDE SCROLLER\Code"
is where I placed the code - should this be moved to

"C:\Users\User\Documents\ZOMBIE 3d SIDE SCROLLER\"

Thanks for your response TDK, I'm finding this forum very helpful.

Login to post a reply

Server time is: 2024-09-28 12:22:13
Your offset time is: 2024-09-28 12:22:13