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 / mouse around object

Author
Message
Zokomoko
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 18th Apr 2004 17:26
i looked but didn't find a post about this.
How can I rotate the camera around an object ?
Lord Helmet
21
Years of Service
User Offline
Joined: 30th May 2003
Location:
Posted: 18th Apr 2004 18:39
Here, you put in the actual code if you can, I'll leave the steps.
`make your object, well pretend it's number is 1
Do
`position the camera at the same point as object 1
`turn the camera w/mouse or keboard as you desire
`use "move camera" command w/a negitive value to move it back
loop
Zokomoko
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 18th Apr 2004 19:32
I think you misunderstood me.
The camera should always look at the object, when you move the mouse it will look at it from different angles.
If you move the mouse up, then the camera will move up and forward and look at the object.
Like an orbit.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Apr 2004 20:05
thats what lord helmet told you to do, this is the same thing in actual code.

sync on:sync rate 60
make object sphere 1,3
color object 1,rgb(255,0,0)
for i=2 to 20
make object sphere i,1
position object i,rnd(10)-5,rnd(10)-5,rnd(10)-5
color object i,rgb(rnd(128)+120,rnd(128)+120,rnd(128)+120)
next i
do
position camera 0,0,0
if leftkey() then turn camera left 1
if rightkey() then turn camera right 1
if downkey() then pitch camera down 1
if upkey() then pitch camera up 1
move camera -4
sync
loop

basical you place the camera at the center of the object and then rotate the camera, then move it backwards so you are above the "planet", then do a sync, so the final position is seen.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.

Login to post a reply

Server time is: 2024-11-11 12:30:02
Your offset time is: 2024-11-11 12:30:02