megaman54 Posted November 6, 2011 Share Posted November 6, 2011 I have a question here. How i can smoothly move the camera from place A to place B without instant warp? Link to comment
Castillo Posted November 6, 2011 Share Posted November 6, 2011 I would say setCameraMatrix, maybe onClientPreRender slowly change the position. Link to comment
megaman54 Posted November 6, 2011 Author Share Posted November 6, 2011 So i must add multiple cordinates and multiple setCameraMatrix functions and trigger them with onClientPreRender? Link to comment
12p Posted November 6, 2011 Share Posted November 6, 2011 Unless your camera is moving only in a specific direction, then yes, you need to set multiple coordinates. Link to comment
megaman54 Posted November 6, 2011 Author Share Posted November 6, 2011 What i'm trying to do is this: the camera moves in a interior from room to another when the user switches the GUI menu. So the camera must move and rotate in multiple directions. Link to comment
12p Posted November 6, 2011 Share Posted November 6, 2011 Then I suppose you know what to do, do you? Link to comment
megaman54 Posted November 6, 2011 Author Share Posted November 6, 2011 Well, i dont... Link to comment
12p Posted November 6, 2011 Share Posted November 6, 2011 For example: Suppose I want to move an object X from place A to place B. Distance between both is 100 units. Okay? Remember that "speed = distance/time" If I want X to be moved to B in 5 seconds: you must use onClientPreRender (or onClientRender, dunno which is better), and then set X's position relative to "100/fps" (fps may be around 30, if I'm right) from A to B (it's + math operation). Link to comment
megaman54 Posted November 6, 2011 Author Share Posted November 6, 2011 That clears it nicely, thanks . But do i have to calculate the fps too? Link to comment
12p Posted November 6, 2011 Share Posted November 6, 2011 It was an idea. Actually I have no idea about the time that GTA uses xDDDD. But you can use 30 as your reference (give it more or less value), it will work anyway. Link to comment
megaman54 Posted November 6, 2011 Author Share Posted November 6, 2011 Ok, thanks I will try this tomorrow when i have more time. Link to comment
NotAvailable Posted November 7, 2011 Share Posted November 7, 2011 Attach it to an object and move the object. Update camera position by using the event onClientPreRender. Link to comment
12p Posted November 7, 2011 Share Posted November 7, 2011 Attach it to an object and move the object. Update camera position by using the event onClientPreRender. God, I was going to post that lol Seriously, I thought "why not moveObject for camera?", /me remembers the objects and... Eureka lol This can be used for rotation too; the last three arguments on moveObject aids that. You can also set your camera facing point from the direction with some useful functions in the wiki Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now