Goal: Wrap a panoramic Image/Video around a Cylinder and control a "camera" on the inside to look around a pano.
First thing's first, I cannot find any example of an image, let alone a video, wrapped around a cylinder. Anyone know how to do this?
I think I should be fine with the interactive aspects of controlling the viewport with the mouse or arrow keys, but I have no clue how to begin with this cylinder stuff, as I'm kinda a noob with CSS transformations and 3d webkit coding…
Love you long time - thank you so much for any answers! -Joel
I just did this exact same thing today. I came across this question this morning, so wanted to post a bit of help.
Generated code:
the outer divs are the cylinder itself. The 3 "view-Cylinder-Item" divs are faces on that cylinder. This particular example is split into 50 faces (cut for brevity sake), so each face is rotated by
7.2 degrees
. ThetranslateZ
of the faces is calculated by basic geometry (pythagoras:sqrt( radius^2 - face_width^2 )
. Radius is calculated asimageWidth / Pi / 2
and is used in thetranslateZ
of the wrapping div (1222... pixels
). Each face is also offset by-50%
(left: -77px
) to place it in the correct location.Hope this helps a bit, I know this is question is a few months old.