Showing posts with label 3D. Show all posts
Showing posts with label 3D. Show all posts

Friday, March 27, 2015

Preparing Media For The 3Sixty Space at York




In a recent student project to create archaeological exhibitions in the 3Sixty space we needed to look at how to easily chop a very wide movie into four separate smaller movies.

There are lots of templates to help you present in the 3Sixty space, including Powerpoint files but we also needed a way to view the presentations NOT in the space itself which would require some form of 3D version of a 2D presentation shown in real 3D. Are you keeping up? We needed a version of the presentation that could be viewed on screen rather than in the room.

I found a python library that would let you edit videos using code called MoviePy. It's brilliant! You can do video-in-video effects, split panel videos, animations, freeze frames and all sorts.

So, with the code below, we were able to take a VERY WIDE movie generated by the Powerpoint template being exported as a movie... and make four separate movie files, one for each wall.



from moviepy.editor import *
from moviepy.video.fx.all import *

movie_file = "/Library/WebServer/Documents/Three.js/ExportedFromPowerpoint.mp4"
w = 1440 #3840 #width of full movie
h = 244 #600 #height of full movie
s = w / 4 #individual screen size i.e 960
print "Chopping..." #.subclip((0,0.0), (1,10.0))

clip1 = (VideoFileClip(movie_file))
wall1 = crop(clip1, x1=0, y1=0, x2=s, y2=h) #Wall 1
#wall1 = wall1.without_audio()
wall1.write_videofile("wall1.mp4", codec='libx264')
print "Chopped: wall1.mp4", wall1.duration, "seconds long."


clip2 = (VideoFileClip(movie_file))
wall2 = crop(clip2, x1=s, y1=0, x2=s*2, y2=h) # Wall 2
wall2 = wall2.without_audio()
wall2.write_videofile("wall2.mp4", codec='libx264')

print "Chopped: wall2.mp4", wall2.duration, "seconds long."

clip3 = (VideoFileClip(movie_file))
wall3 = crop(clip3, x1=s*2, y1=0, x2=s*3, y2=h) # Wall 3
wall3 = wall3.without_audio()
wall3.write_videofile("wall3.mp4", codec='libx264')
print "Chopped: wall3.mp4", wall3.duration, "seconds long."

clip4 = (VideoFileClip(movie_file))
wall4 = crop(clip4, x1=s*3, y1=0, x2=s*4, y2=h) # Wall 4
wall4 = wall4.without_audio()
wall4.write_videofile("wall4.mp4", codec='libx264')
print "Chopped: wall4.mp4", wall4.duration, "seconds long."

print "Chopped: All done!"

It's worth noting that we only needed audio on one of the movies, otherwise four tracks of the same audio played causing a weird echo effect.  Also, unless the codec was libx264, the movies didn't load into the Three.js space.

After this we were then able to use the movies in a 3D simulation of the room.

See how this was used here.

Tuesday, January 20, 2015

The Solution: Rendering video onto the inside walls of a 3D room

So after a lot of experimentation, I decided that WebGL was a good way to go ( see an earlier post  about automatically showing videos on a 3D models walls).

I took the video example and simply hacked around, watching where objects move to when I changed values, and then added extra objects, in this case walls.



And it worked! Which is pretty impressive ( I think ) for someone who knows nothing about 3D programming. Here is a live version showing music I loved from the 70s.

Monday, January 12, 2015

The Problem: Rendering video onto the inside walls of a 3D room

A thinking out loud post...

The Scenario

At the university we have an amazing room called the 3Sixty. It's a room that can have media projected onto all four walls (and there's some amazing speakers in there too ).  Sara Perry runs a module in there for archaeology students to design a museum exhibition. Last year the students created World War I exhibitions using Powerpoint and YouTube videos. They were very moving. I almost cried at one about a loyal Alsatian.

The Problem

The problem is this... The students use a very wide ( four walls ) Powerpoint template to create their 3Sixty presentation, but once made, the only place you can really experience this presentation is in the room itself. It would be good if these .ppt files ( or exported movies ) could be projected onto a 3D version of the room. It's a very simple render, I think, but would allow people to see the presentations without being in the room.

Having no experience of 3D modelling, I dived in and had a go with a few tools.

Google Sketchup

This seems very easy to use. I went for the primary school version, Sketchup Make, hoping the simplicity would be useful.

I found I could easily add images to planes and that there's an extension called Video Texture Plugin  which seems to be able to render video onto a surface but it's Windows only.


Using Sketchup I exported the model as a VRML file and then was able to view the model using an app called FreeWRL.



Blender


I then had a play with Blender.  Regular plain ole 3D modelling may be the way to go.  I discovered you can add a video as a surface texture to a plane. The picture below doesn't look very impressive, but it IS a video on a wall ( try to ignore the box .. ahem). Yes, I'd need to learn how to use the software :-)



Clara.io

I tried an online 3D editor called Clara.io (shown below) which I failed to master in the five minutes I tried it :-) It does look incredible, although I'm not sure if I can stick a video onto a plane. This tool did have a large library of objects like chairs, cars and objectified 3D women in bikinis and thigh boots.



Conclusions

Traditional 3D modelling may be the route to follow, I don't know. I bumped into someone while tinkering on this who mentioned the Unreal Engine, but, like 3D modelling, it doesn't half seem a massive mallet for a very tiny nut. 

We almost need a Doom-like clone but with only one room...only simpler... (something like this maybe...)

I was hoping for something that we could automate the conversion from Powerpoint ( or video ) into an online viewable something.... something like WebGL maybe.  Like this... or this below...except instead of web pages, we might have a page with just a video in. In order to do this we'd just need to "chop" each wall of our very wide Powerpoint movie into each individual wall.


This Three.js WebGL HTML5 tutorial might be a good place to start.

Blimey, if this is possible, it must be doable. Here a video becomes a model... Wow! Like this only a million times simpler!



 

© 2013 Klick Dev. All rights resevered.

Back To Top