I have
OnStart (Not code)
Curs: SpawnModel CursorModel
OnRender (& OnUpdate since OnRendering didn't work) (Code)
Curs.Position.X = App.MousePosition.X;
Curs.Position.Y = App.MousePosition.Y;
but the position of the model doesn't change

Moderator: Moderators
Code: Select all
int X = (App.MousePosition.X+1)*ViewportWidth/2;
int Y = (1-App.MousePosition.Y)*ViewportHeight/2;
Ok. I guess that seemed to give RenderText a more accurate depiction of the actual values.y offs et wrote:The co-ords are x -1 to +1, Y -1 to +1
RenderText renders whole numbers, so make FloatMultiply 10.0
As to model to model, I suggest using a more global approach using app/states.AppState's and using ZExpressions from there.
take care that this depends on the Camera Settings. a camera with FOV 45 situated at position [0, 0, 1] and a square viewport (window) will look at the area between -1/+1 for x and y. when you put it further away on the z-axis or enlarge the FOV, the visible area will enlarge.y offs et wrote:The co-ords are x -1 to +1, Y -1 to +1
I figured that. I haven't changed the camera from the default, and don't plan on changing it, so hopefully nothing will break during developmentdiki wrote:take care that this depends on the Camera Settings. a camera with FOV 45 situated at position [0, 0, 1] and a square viewport (window) will look at the area between -1/+1 for x and y. when you put it further away on the z-axis or enlarge the FOV, the visible area will enlarge.y offs et wrote:The co-ords are x -1 to +1, Y -1 to +1
Unfortunately, I believe I'd need a KeyUp component for that...diki wrote:physics are not yet a part of zge, so i'm afraid you'll have to script your own.
Code: Select all
CurrentModel.Position.X = PlayerModel.Position.X;
CurrentModel.Position.Y = PlayerModel.Position.Y;
CurrentModel.Position.Z = PlayerModel.Position.Z -2;
CurrentModel.Rotation = PlayerModel.Rotation;
//CurrentModel.Rotation = App.CameraRotation;
centerMouse();