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.

AppGameKit Classic Chat / as I do for camera following a 3D object?

Author
Message
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 14th Feb 2015 21:40
hello guys, how do I do to camera following a 3D object?

PrintC("Hello EveryOne !&quot
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Feb 2015 21:52 Edited at: 14th Feb 2015 21:57
distance is
dx=x2-x1
dy=y2-y1
dz=z2-z1
d=sqrt(dx*dx + dy*dy + dz*dz)

delta y u can use for up down new y = old y + value

SetCameraLookAt
MoveCameraLocalZ move for or back belongs distance
GetCameraX
GetCameraY
GetCameraZ
SetCameraPosition
GetObjectX
GetObjectY
GetObjectZ

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 14th Feb 2015 23:03 Edited at: 14th Feb 2015 23:04
Here's an example of a simple 3D driving game which has a simple 3rd person camera.

It's written in V1 but works in V2.

3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 16th Feb 2015 13:06 Edited at: 16th Feb 2015 14:23
you can also use atanfull to turn the player around if you have 2 cords for the player, and 2 cords for what it needs to look at. you can use atanfull if the object moves on the xy plane.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.

Login to post a reply

Server time is: 2024-11-25 17:50:36
Your offset time is: 2024-11-25 17:50:36