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 / About my 3rd Person Camera view

Author
Message
EJ Will
21
Years of Service
User Offline
Joined: 23rd Jul 2003
Location:
Posted: 16th Aug 2003 23:55
Ok i'm starting out doing some simple 3d, i've loaded a model and placed in DBPro (hooray for me!), but i've come to a point where something doesn't make sense to me.



The above code lets me have my camera at a reasonable distance and height. However when i want the camera to look down slightly on the car (that model) by increasing the position of the camera's Z value, the screen flips upside down. I don't know if this is suppost to do that, but it's really getting on my nerves cause it makes sense to me.

Any Reply would be appreciated...

Will
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 17th Aug 2003 00:44
That code does not make sense. Give us something more to work with

"We are getting aggravated"
"Yes, we are"
EJ Will
21
Years of Service
User Offline
Joined: 23rd Jul 2003
Location:
Posted: 17th Aug 2003 00:57
Okey Dokey, right i'll give some pictures aswell:

Ok what the code does is grab a point using the car as the center of the calculations:



The code above uses the x,y and z+5 value of the model (#car being the model). I have added 5 to the z value so the point is a little higher than the model. After this I make the camera position itself just behind the model.



now whenever i make the z value of the camera's position higher than the z value of the point it's looking at, the screen turns upside down. As shown:



Hope this has made it a bit more clearer, i have attached source code aswell.

Cheers,
Will

EJ Will
21
Years of Service
User Offline
Joined: 23rd Jul 2003
Location:
Posted: 17th Aug 2003 14:45
Ok being as though it seems to baffle others aswell, does anyone know of a better way to make a 3rd Person view? Because i can't go much further unless i get my camera's sorted.

Regards,
Will

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 17th Aug 2003 15:15 Edited at: 17th Aug 2003 15:16
Nice car...

Anyway - it looks like you might be misunderstanding something.

you've got point camera car#, car#, car#+5 which doesn't really make sense. How can car# hold the values for the x,y and z position of your car?

Make variables like px#, py# and pz#. Let these three values hold the x, y and z position of your car.

Then use something like:

I'm not sure if you're familiar with the newx/zvalue commands, but they'll find a point in space, using cos/sine, which will be 50 units away from the 1st parameter (px#/pz#). The 2nd parameter, 0, is at which angle these commands work. Change it to 90, 180, 270 and you'll get side on and frontal type views.

After a while, you might find it a good idea to change the 2nd Parameter to be the current facing angle of you car (the y angle).

Hope this helps...

I opened the case to my PC today and thought, my exhaust fan sucks.
EJ Will
21
Years of Service
User Offline
Joined: 23rd Jul 2003
Location:
Posted: 18th Aug 2003 01:36
Ahhh I get it now

Cheers bud, and thanks for the explanation of the code, it was really helpful thanks

Cheers,
Will

Login to post a reply

Server time is: 2024-11-25 04:53:57
Your offset time is: 2024-11-25 04:53:57