Camera help
-
I need to make the camera follow a ball for a simple game. But i don't know how to code the object so that it will. Could someone please help me?
-
Hey!
If you dowload SketchyPhysics 3.1 http://sketchyphysics.googlecode.com/files/SetupSketchyPhysics3.1-Sep27.exe that CPhillips released a few days ago at this forum, http://forums.sketchucation.com/viewtopic.php?f=61&t=31262&start=0.Then you can use this script in an objects script-field:
ontick{ camera.set(camera.eye,transformation.origin,[0,0,1]) }
This will follow the object that you need.
/hpnisse (script is from CPhilips, that created SketchyPhysics 3.1) -
@hpnisse said:
Hey!
If you dowload SketchyPhysics 3.1 http://sketchyphysics.googlecode.com/files/SetupSketchyPhysics3.1-Sep27.exe that CPhillips released a few days ago at this forum, http://forums.sketchucation.com/viewtopic.php?f=61&t=31262&start=0.Then you can use this script in an objects script-field:
> ontick{ > camera.set(camera.eye,transformation.origin,[0,0,1]) > } >
This will follow the object that you need.
/hpnisse (script is from CPhilips, that created SketchyPhysics 3.1)It tracks an object, not follows it. I need the object to always be followed from overhead and the code to be ontick compatible, not scripted compatible.
UPDATE: I HAVE DOWNLOADED SP3.1.
-
Okay! Sorry
If you want it to follow a object, then
- Add a scene.
- Open Scene Manager
- Add camera follow NAME (NAME is the name of the object you want to follow).
(If you want to TRACKa object just write camera track NAME insted.)
If you don't know how to name objects:
- Select a group/component.
- RightClick on that.
- Click: Entity Info
- There you have a box that is called Name:.
- Just type in anything.
Hope this is what you searching for.
/hpnisse
-
Thanks!
BTW i can use a scripted field, i just had rc1 until 3.1.
-
Hello!
The text Camera track NAME should be in the Scene Description.And if you want both Track and Follow in the same scene, you need to type in.
Camera track NAME. Camera follow NAME
in the Scene Description. (you can have diffrent name on track and follow objects)I've tested it right now cause I didn't remember, but I got it to work.
Hope you get it to work to.
/hpnisse
-
Hello again!
I had done a .skp file now that simulates this really good, I think. So if you cant run the simulation (track/follow) correct, then I don't know what it is.
It's a very basic model, with two box with name on, Track and Follow. Right below the names there is letters, that is how to move the box right/left. (WASD keys are used)Here is the file:
TrackFollowTest.skp/hpnisse
-
Really good that you got it to work!
Pre-release SP 3.2 if from the topic
http://forums.sketchucation.com/viewtopic.php?f=61&t=32200
and the direct downloadlink to SP3.2 (windows installer):
http://sketchyphysics.googlecode.com/files/SetupSketchyPhysics3.2-Nov1.exe
This version can support midi music or something, watch that topic. The files that was uploaded there was awesome!/hpnisse
Advertisement