How to make the sphero keep rotate on the spot? - rotation

I am new to Sphero development. I saw the app 'Drive' could make Sphero keep rotating before calibration. Anyone have idea how to make it?
I tried [RKRollCommand sendCommandWithHeading:90 velocity:0.01f stopped:YES] to adjust the header, but it just rotate 90 degree, anyway I could make it keep rotating?

Try using a rotate over time command paired with a delay in a macro, this is how we do it in the drive app. MacroLab comes with at least one built in macro that demonstrates this.

Related

Camera texture in Unity with multithreaded rendering

I'm trying to do pretty much what TangoARScreen does but with multithreaded rendering on in Unity. I did some experiments and I'm stuck.
I tried several things, such as letting Tango render into the OES texture that would be then blitted into a regular Texture2D in Unity, but OpenGL keeps complaining about invalid display when I try to use it. Probably not even OnTangoCameraTextureAvailable is called in the correct GL context? Hard to say when you have no idea how Tango Core works internally.
Is registering a YUV texture via TangoService_Experimental_connectTextureIdUnity the way to go? I'd have to deal with YUV2RGB conversion I assume. Or should I use OnTangoImageMultithreadedAvailable and deal with the buffer? Render it with a custom share for instance? The documentation is pretty blank in these areas and every experiment means several wasted days at least. Did anyone get this working? Could you point me in the right direction? All I need is live camera image rendered into Unity's camera background.
Frome the April 2017: Gankino release notes: "The C API now supports getting the latest camera image's timestamp outside a GL thread .... Unity multithreaded rendering support will get added in a future release.". So I guess we need to wait a little bit.
Multithreaded rendering still can be used in applications without camera feed (with motion tracking only), choosing "YUV Texture and Raw Bytes" as overlay method in Tango Application Script.

sf::View visibility Check

Ok, so I've been working on a game with some friends for a school project. We have used SFML.
I've been working lately on the camera and a tile implementations system and now I need them to work together.
The camera works like this:
I have two different sf::View, one for the game world and one for the hud. The one for the game world follows the player in the x-axis.
The tile system works in a way where it reads in a txt file and draw sprites based on the information from the txt file.
As it is now I always draw all the tiles, even if it's outside of the cameras view. Not good. I need a way to check if the tiles are outside of the cameras view before I draw them. How do I do this?
I did find this:
Get X and Y offset of sf::View
but I can't really wrap my head around how to make this info work in my game.
Any help would be really appreciated! :)
Mvh Elis
Managed to figure it out after finding this:
http://fr.sfml-dev.org/forums/index.php?topic=10590.0

Modifying animation to match a keyframe in another

I have an Idle animation with arms holding a weapon which I have tweaked so It would work with a weapon I had created, I also have a running animation for the same arms which I need to tweak as well to work with my weapon, Is It possible to use the first keyframe from the Idle animation to offset the running animation's key to match it?
Ok so if anybody needs this in the future, I ended up using 3ds max's merge animation, it worked perfectly.
I've edited my previous answer to clearly state how this is done.
First, you want to export your idle animation. This can be done using the ATOM exporter in Maya or a third party plugin like PAIE or Studio Library. From here you can choose to only export the first frame or all frames. Make sure to select all the relevant controllers.
Secondly, you open up your running animation and select the same controllers as before, and then create a new animation layer with that selection. Animation layers are found in Channel Box / Layer Editor as a tab called Anim.
After setting up the layer, you can import your idle animation onto the layer. Again, this can be done using ATOM or a third party plug-in. Perhaps lock the BaseAnimation layer to prevent accidentally changing it. If you only wish to merge certain parts, like the arms, make sure to only export, import and add that animation to the animation layer.

Calling functions only after drawing is completed

I am making a drawing on NSView using a timer that is set to update every .02 seconds. On update some physical simulation makes a step, and then Canvas!.needsDisplay = true. It works when app is in foreground (usually), but when some lags happen, simulation progresses forward despite the fact that view hasn't reflected it yet. How do I pause the timer during these times to make simulation happen only when NSView can show it? I do not want to call step_over from inside drawRect, cause it seems like a bad idea, because then it would be harder to stop the simulation.
Generally this kind of update should be done the other way around, by letting the display ask you for frames as it can display them. This is done with a CADisplayLink CVDisplayLink (this is Mac; CADisplayLink is iOS). Configure it with a method you want to be called when a frame can be drawn.
Generally you do want your simulation to keep moving forward, even if it means dropping frames occasionally. For that, you check the timestamp and use that to work out what time to use for your new frame. But if you only want to move forward when the display can show it, then just update once per call.
Note that generating at 50fps is often going to mismatch the system that's trying to draw at 60fps, so you're going to wind up missing frames occasionally. That's one of several reasons not to try to push drawing with a timer.
See also Alternative of CADisplayLink for Mac OS X. Note that trying to draw at 50fps with Core Graphics usually isn't going to give good results in any case. The right tool here in OS X is Core Animation (or SpriteKit for games on 10.10, or OpenGL for more advanced high-speed rendering). You can do very basic animations with an NSTimer (and we did for years before Core Animation came along), but it's not really a tool for complex drawing.

how to create animation of sparkling effect for iphone using cocos2d or Quartz core

I am creating one application in that i want to give background effect like there are number of starts and something like we are in universe and some starts are getting lighted for few seconds then some other starts etc.
I got one open gles animation of Explosion , but I want that kind of effect using quartz core or Cocos2d so that I can implement other things easily.
if any one do have any idea or any sample for the sample please suggest me.
Thanks in advance
If I understand you question correctly (that is not quite clear) you can use some particle effect to simulate most of the "cosmic" lighting, starts, comets even galaxy.
Please have a look at http://www.cocos2d-iphone.org/archives/926 , it is particle tutorial

Resources