Mostrando entradas con la etiqueta CoreAnimation. Mostrar todas las entradas
Mostrando entradas con la etiqueta CoreAnimation. Mostrar todas las entradas

sábado, 23 de febrero de 2013

JAPanoView updated: Hotspots

Just updated my panorama viewer UIView subclass. It now supports hotspots: instantiate any UIView subclass and add it as a hotspot with the new method addHotspot:atHAngle:vAngle: indicating the horizontal angle (azimuth) and vertical angle (elevation). To remove a hotspot form a JAPanoView just call removeFromPanoView on the hotspot instance (like addSubview: and removeFromSuperview).

Since any UIView can be a hotspot, you can add any UIControl or add any UIGestureRecognizer to your hotspot and make it fully user interactive. You can also take advantage of the convertPoint/Rect:from/toView: UIView methods and show popovers from a hotspot as seen in the demo project:


[popover presentPopoverFromRect:hotspot.frame inView:hotspot.superview permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];


There's also a new property for UIView shouldApplyPerspective. It indicates if the hotspot should be rendered always parallel to the screen (shouldApplyPerspective==NO) or perpendicular to the point-of-view/hotspot axis (shouldApplyPerspective==YES; default value).

You can get the code from the repository at bitbucket.

domingo, 4 de marzo de 2012

JAPanoView: open source panorama viewer

I've just published an open source UIView subclass to make awesome interactive 360-180 degrees panorama from 6 images, one for each face of a cube.

The underlying foundation of this component is the CATransform3D matrix from CoreAnimation framework. Applying the correct 3D transform to each of the CALayers you can get a 3D illusion from 2D images. More details on the topic can be found here: Core Animation: 3D perspective

You can get the source code from my bitbucket repository: https://bitbucket.org/javieralonso/japanoview/


Special thanks to Russ Woodman from Remedy Panoramic Design for his permission to use his photos for the sample project.

Update: it now supports hotspots.