|
Post by Rafay Jutt on Apr 19, 2017 12:23:30 GMT
Hello! Can someone tell me how can i make the camera orbit the car and stop after i press a key ?
|
|
|
Post by Power Supersport on Apr 19, 2017 17:10:08 GMT
Hey there... There's a demo project, called ExplosionParticles.3dr that includes a script that rotates a camera arround an anchor point... I've modified that script and built a demo project for ya... ( Yes, it is working) Attachments:Orbit.3dr (112.05 KB)
|
|
|
Post by Rafay Jutt on Apr 20, 2017 11:06:18 GMT
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 21, 2017 14:04:00 GMT
Go into the script usage examples and select RotateCameraAboutObject.Obs float Speed = 0.2; float Radius = 20; float Altitude = 5; float Time = 0; void Main() { Vector3 camLocation; Vector3 targetLocation; iObjectLocation(OBJ_3,targetLocation); camLocation.x = targetLocation.x + iFloatCos(Time)*Radius; camLocation.y = targetLocation.y + Altitude; camLocation.z = targetLocation.z + iFloatSin(Time)*Radius; iObjectLocationSet(OBJ_0,camLocation); Time = Time + Speed; }
|
|
|
Post by commended on Jul 1, 2017 22:22:49 GMT
Is there a way to do this with the mouse?
|
|
hawk
Full Member
Posts: 69
|
Post by hawk on Jul 24, 2017 4:49:25 GMT
commended The thing that controls the position of the orbiting camera in the script that @neonstudios showed here are the Time and Altitude variables, what you can try is modifying the Time value based on the position of the mouse on the screen using something like iMouseX() and Altitude using iMouseY(). And that should give you a nice mouse controlled orbiting camera (DISCLAIMER: I didn't try this, just thought of it in one go, some experimentation might be necessary to get it right)
|
|
|
Post by commended on Jul 27, 2017 9:28:26 GMT
Thanks hawk ,will try this out soon.
|
|