hi
i had found this code, and i try to modify it with out luck. so now i ask for some help.
first of all i need a 360 degree rotate camera. it rotate like i want around y now. cant get it to rotate around x
and when you rotate a bit, and release the mouse bottom and move the mouse and then hir the buttom Again, it jumps when start rotaet Again. is there a way to make it continue from where it was with out jumping.
load object "C:\dbp\projects\MagicCube\Data\Cube\Center.x",1
rem Start a loop
SYNC ON : DO
rem Now we handle the camera
`If user presses right mouse button, alter camera angle value but adding the angle value to the mouse's movement in the x-axis
if mouseclick()=1
camYangle#=Wrapvalue(camYangle#+MousemoveX())
endif
If mouseclick()=2
camXangle#=Wrapvalue(camXangle#+MousemoveY())
endif
`Apply limits on the camera x angle (i.e. y position) - this way camera is prevented from going up too high or too low
If camxangle#>90 then camxangle#=0
if camxangle#<0 then camxangle#=0
`Here i'm setting the distance so that the camera will be right on top of the character when camera is pointing straight down
`Basically, when the camera is on the ground point straight at the character, the distance should be 200. When it straight above, distance should be 0. Therefore I use this formula to achieve just that
dist#=200-(camxangle#*200/90)
rem Update camera position
`Use newvalues to find a point 200 units *behind the character's position but using camera's yangle value so that user can control camera's rotation around the character object
camx#=NewXValue(Object position x(1),camyangle#,-1*dist#)
camy#=NewYValue(Object Position y(1),camxangle#,-200)
camz#=NewZValue(Object position z(1),camyangle#,-1*dist#)
`Curve the camera values
camx#=Curvevalue(camx#,Camera Position X(),5.0)
camy#=Curvevalue(camy#,Camera Position Y(),5.0)
camz#=Curvevalue(camz#,Camera Position Z(),5.0)
`Update camera position
Position Camera camx#,camy#,camz#
`Keep camera pointing at character at all times
Point Camera Object position X(1),Object position Y(1),Object Position Z(1)
SYNC : LOOP
Thx