Hi everyone!
i’m new here and have one question. How can i controll the camera with the mouse? I search an script to controll the cam-rotation per mouse (in 3D)!
Thanks a lot! :o
Hi everyone!
i’m new here and have one question. How can i controll the camera with the mouse? I search an script to controll the cam-rotation per mouse (in 3D)!
Thanks a lot! :o
Hello and welcome.
Probably someone will point you to a cam script, but until that, you can download
many of the “demos/games” available ( check in the site) and pick one of the
scripts ( we all do this…well, me at least )
Iy’s the best way to learn.
Bye
António
here is the script that i just made recetly,
it can help you…
import GameLogic
import Rasterizer
ww = Rasterizer.getWindowWidth()
wh = Rasterizer.getWindowHeight()
aspect = float(wh)/ww
actionx=23
actiony=actionx*aspect
c = GameLogic.getCurrentController()
sensor = c.getSensor(“mouse”)
owner = c.getOwner()
owner.x = float(sensor.getXPosition()-ww/2)/wwactionx
owner.y = float(sensor.getYPosition()-wh/2)/whactiony
owner.setPosition([owner.x,0,-owner.y])