Category Archives: Uncategorized

Making a fake reflective disco ball in Altspace SDK

Hey all. I got asked to write up a little about how I pulled of a fairly convincing spinning discoball in AltspaceVR. The SDK doesnt really support dynamic lighting, or reflections, so we have to approach this as a bit of a visual trick.

When you look at a disco ball, all you are seeing is a normal chrome ball, but the faceted reflections means each face of the ball is reflecting just a fraction of the area it would be on a smooth surface. However overall the reflection is still spherical, just with a lot of gaps between the reflected areas.

So I thought, we can do this with some UV jiggerypokery!

So First, Here’s what we’ll be making:

discoball

ooooo shiny!

The most important part of this is prepping your sphere. A simple hard faced sphere wont work because we need the faces’ UVs to be very separated and isolated, but still in the right places relative to the other faces.

So here’s what I did:

Made a sphere, woo! sphere

Then I mapped my skybox image onto it. This could also be a proper reflection sphere image for the location you plan to place the ball.  Here’s the image I used (made from Altspace’s own skybox):

smallsky

Here it is assigned to my sphere.  Note the sphere is created with perfect UVs for this to map seamplessly: spheretextured

OK, so that’s a nice ball. Now we need to Separate the faces in the UVs so we get that faceted look. I also hardened the normals on the mesh at this point.

So Here are the UVs to begin with: startuvs

But we need to split the faces so they are no longer connected, and then shrink them into themselves. After separating the edges I used a Maya MEL  script I found here to shrink each UV “Shell” down towards its own center. Resulting in this:

separateduvs2

Here’s how things are looking in our 3D view:

sphere2

Now the trick here is that in Altspace we’ll use code to offset the image across these UVs horizontally.  The separation will make them seem to flash and sparkle.

The relevant code in Altspace, after loading the object is:

discoballMat = discoball.children[1].material;
discoballMat.map.wrapT = THREE.RepeatWrapping;
discoballMat.map.wrapS = THREE.RepeatWrapping;

This puts the current material to a variable. and then sets the map of that material to repeat the texture in all directions. So that once we start animating it to the side there’s another of the same image to go into.

The relevant part in the animation loop is this:

discoball.rotation.y += 0.01;
discoballMat.map.offset.x = (THREE.Math.radToDeg(discoball.rotation.y)/360);

And with that, you should have this!

discoball

Quick tip – PROPERLY auto-mounting unprotected Windows shares in linux with full access

I’m mostly writing this to help myself when I need to do this again. This is how you mount a windows share at boot, with full write privileges.

ON WINDOWS
Share your folder
make sure the owner is set to “Everyone” and be sure to add “Anonymous” as a user with full access (when you type in Anonymous, it should correct to “ANONYMOUS LOGON”). This should be done in share permissions as well as folder permissions. Make sure folder is not read-only on windows.
GUEST ACCOUNT may need to be activated:
gpedit.msc -> Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options ->
Accounts: Guest account status: enabled -> REBOOT

ON LINUX

Make the folder to mount in
sudo mkdir /media/mountname

Now edit your Fstab file to set up the mounting
sudo nano /etc/fstab

add lines like this:
//192.168.1.XXX/ShareName /media/mountname cifs username=guest,password=,rw,uid=1000,gid=1000,dir_mode=0777,file_mode=0666,iocharset=utf8,sec=ntlm 0 2

The share address can be any valid UNC path. You can use hostname instead of IP if you want.

Explanation:

username=guest,password= – This is your login info for the share. Since the share accepts guest access we are using the guest user, which has no password (but you must define it blank or it will prompt for one)

rw – mounts the share with read/write permissions

uid=1000,gid=1000 – This sets the user and group info for the mountpoint folder. You can find what values you should use by typing id -u and id -g in the terminal.

dir_mode=0777,file_mode=0666 – This sets the standard access permission for the directory and files. 777 and 666 will give complete access to everything in these folders, by everyone.

iocharset=utf8 – This is a compatibility thing to properly support filenames with odd characters or other languages.

sec=ntlm – This is important. It’s the authentication protocol to use while mounting. NTLM is what most normal windows desktops will use by default. For more info about NTLM click here.

0 2 – These two numbers are order priorities. Basically the first one says if it needs to call sync before unmounting, which we don’t need. The second number is just which pass of mounting it will try to mount this in. Since /media (where our mountpoint is located) isn’t available until the root filesystem is mounted in pass 1, we need this to happen in pass 2. A 0 for the second number will still work because it keeps retrying every failed mount every pass until it works. But no reason to make it messy like that. so 0 2 is safe and clean for cifs.

Done! Go ahead and force a remount by typing sudo mount -v -a to (re)mount everything listed in your fstab file. (-v means verbose for feedback if it fails, -a means all)
Or you can just reboot. You should now see the share’s contents in the mountpoint you specified. And you should have full write privileges. If you dont, check the troubleshooting below.

Troubleshooting
If this doesnt work for you check all info then try:
smbclient //server/share -U guest
and leave password prompt empty and hit enter. If this gives an error then something on the windows side is wrong. If it works with smbclient, but doesn’t in fstab, probably your security type is wrong. check man mount.cifs – around line 327, to see other security options.

You can also try to use the mount command directly to test your options. Be sure your mountpoint is empty before mounting by running sudo umount -l /media/mountpoint
To mount our example share the command would be:
sudo mount -v -t cifs -o username=guest,password=,rw,uid=1000,gid=1000,dir_mode=0777,file_mode=0666,iocharset=utf8,sec=ntlm //192.168.1.XXX/ShareName /media/mountpoint
-v means verbose, -t means “type”, and -o is for listing options. Any errors here are the same errors you will get when automounting with fstab.

PirateBox is a really cool project!

So I recently discovered a project called PirateBox. It is an open source project designed to give people an easy way to share files, without using the internet as a backbone. Instead, PirateBox focuses on local area networks, like a coffee shop, library, or home WiFi.

Piratebox is software that can run on any OpenWRT device, or on the cheap ($35) single board computer the Raspberry Pi.

What it does is it makes a WiFi access point that any wireless device can connect to. This box does not access the internet, so you’ll find no internet connectivity while connected to this access point, but what it does offer is a way for users who are close to each other to share anything they’d like, and chat or post on a locally hosted message board. The box hosts a storage location, say, a large flash drive, so that anyone can view or add to it’s contents. Like adding books to your local library.

Useful for parties or events, people can all upload their images and videos of the event to one centralized place while they are there, and those can later be taken in bulk and shared or archived.

The box comes in handy for people in areas with limited or controlled internet to allow free communication and information to flow, while the internet itself may be censored, blocked, or entirely down. Since these boxes are little computers, they can be adapted easily to expand their capabilities.  They draw very little power and are very cheap to set up compared to a full fledged server. Even if you arent interested in PirateBox you should check out some of the things people are doing with Raspberry Pis

PirateBox has a funded brother called the LibraryBox, both projects share a linked code-base.

Check out the PirateBox project at piratebox.cc, or LibraryBox at librarybox.us
I’ll be posting follow up articles about how I set mine up, and what I plan to do with it.

 

-WACOMalt

Blender Adventures

I’m a fairly avid user of open source software.  I believe that when everyone comes together to make something great, they can achieve something just as good as teams that are driven by money. That said, in the open source world, there is some level of disconnect between the quality you can expect from a so called “professional” software, and the open source alternatives.

Sure, you’ll hear GIMP fans clamor over how good GIMP is, but the face of the matter is, if you have a paying job, you probably haven’t been able to switch to a completely open source world.  I know this first-hand. I work daily in Windows, running Adobe, The Foundry, and Autodesk stuff, and I don’t see that changing any time soon.

Now, I could go on and on about my thoughts on for-profit development vs the open source ecology, but that’d be super boring, and really, all we care about is what the programs actually can do, and what they are used for.

Still, I love open source, if only because I feel what it stands for is an awesome thing. More and more though, I am finding myself being legitimately impressed by some open source projects, and sometimes even jealous of their features.

Recently I decided to learn Blender, and I don’t mean learn to make a shiny cube with a light on it, I mean really learn Blender. And to date, I have been nothing but pleased.

So some background first. I am a visual effects artist, I have about 4 years of industry experience so far (check my IMDB link on the right to see). My degree was in computer animation, and my  focus since then has been in VFX compositing.  I love 3D, though my job is generally played out in the 2D world.  I kept seeing posts about this “Cycles” renderer that Blender has been developing and touting more and more as it gets close to being finished, and it made me finally decide to learn Blender.

Blender has improved so much since I last used it I cant even begin to describe. Granted, back then (maybe 3 years ago) I never took the time to properly learn it. The interface is cleaner, the tools work better, and the features have piled up.  This is one software, or should I say one community, that hasn’t been willing to sit still. While Maya has been adding features and improvements, I can honestly say if I went back 3 years in Maya, I really wouldn’t hit many things that I would miss on a day-to-day basis.

Cycles is amazing, and Maya needs to learn how to handle shader networks.  It’s so intuitive, so easy, and so good looking.  I would compare it to UDK’s shader editor, which is also top of the line (especially for a game engine!)

When I have to go back into Maya’s hypershade node network and build a shader, I hate every minute of it now. There are tools like Mental Mill for Maya, but those cost money. 🙁

Blender has some quirks that, as much as blender enthusiasts will call them features, bug the crap out of me though…

The whole rightclick leftclick thing is annoying. If you want to select with right click, at least keep it consistent.  selecting an item with right click in the 3d view, then moving to the outliner and selecting with left click is just silly. Easy enough to change in the settings though. Also, whats with not asking if I want to save when I close the window without saving? O_o That’s been standard in software since like.. the first computer I used. (DOS 6.something)

All of these are settings you can change, but you shouldn’t have to.

In any case, the renderer is very nice, the shading network is amazing, and the whole program is miles ahead of where it was even a year ago.

If Blender keeps up their momentum, they will soon be a major contender, if they aren’t already.

The model and textures are NOT made by me. This is a model from Tomb Raider Underground which I have been using to learn shading networks and lighting in blender.
The model and textures are NOT made by me. This is a model from Tomb Raider Underground which I have been using to learn shading networks and lighting in blender. I just did the lighting, shading, and rendering.