perjantai 24. elokuuta 2012

Dot product explained differently

Dot product is one of the "tools" that is hard to avoid if one is programming anything related to 3D. I have found several attempts to explain the dot product. However, many of them are strictly mathematical. The mathematical explanation of dot product is useful only for those who can read and understand mathematical presentations. This presentation is not aimed to those people :)

This is a one way to see the dot product from a very practical point of view.

Let's see a figure from Wikipedia about dot product:

The figure shows the relation of the dot product and the cosine. For example, if you have two unit vectors (eg. vectors with length 1) and the angle between them is 45 degrees, then the result of dot product is the same as cosine of 45, which is about 0.7

Now, let's draw the same figure a little bit differently.



The vector B is now a plane normal. Now, the dot product of vector A and the plane normal gives us the distance between the vector (a point) A and the plane defined by the normal (yes, a normal itself defines a plane where one of the plane's points is in the origin. Let's call that a "normal" plane").

This is very handy indeed. The dot product can be used as a tape measure.

But this works only if our plane goes through the origin. What if our plane is not in origin? Well, the solution is simple. The distance from any point to any plane is:

the distance between the point and the "normal" of the plane + the distance from the plane to the "normal" plane.

More formally:

dotProduct(the point, the normal ) + dotProduct(the point of the plane, the normal)


I hope this helps someone.

tiistai 14. elokuuta 2012

Updating Blender script -> 2.63

Pyramidaze! in action.

Blender is evolving...


Blender is evolving fast which is a good thing. A bad thing is that also its Python API is changing thus breaking old scripts. But updating old scripts is a good way to learn the new API.

So, I updated my really old pyramidaze script. This simple script iterates through selected faces of the object and adds a pyramid top of them (see image above).

Blender now supports NGons which means that the API has changed also. There were two major changes in this case. The way polygons are accessed has changed due the NGons. Secondly, the API does not provide a polygon center any more, so center must be calculated in the script.

You can find a blend file including the script from here.
http://www.opendimension.org/blender_en/blends/pyramidaze_2.63.blend

torstai 14. kesäkuuta 2012

How to shutdown Ubuntu with one click

Just make a following script and add custom application launcher to the panel:
#!/bin/bash dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown

tiistai 1. marraskuuta 2011

Interested of freedom of speech? Then say no to ACTA!

keskiviikko 14. syyskuuta 2011

Museums, images and non-institutional digital heritage

What do people want from museums? Better metada, better search algorithms? Nope. They want to download images, videos and sounds. Don't believe me? Well, have a look at the Europeana survey 2011: Over 90% of respondents agree that ability to download materials would be "useful" or "very useful".
I gave a little provocative presentation in CIDOC 2011 about museums, images, Google and people outside heritage institutions. My main point was that people want to participate in creating of digital heritage in their own terms, not museums. There is already a very active digital heritage field outside of heritage organisations which often overrules official digital heritage in search engine visibility, usability and coverage. And since search engines (Google) are the main entry points to the internet, official digital heritage is struggling with its visibility. Non-institutional digital heritage is here to stay and museums must decide if they want to be part of that or not.
You can find my slides and full paper from here: http://opendimension.org/ida/papers.php

tiistai 1. maaliskuuta 2011

Are you sure?

Mendeley shows the right way to ask if you want to remove your data!

perjantai 11. helmikuuta 2011

Nokia and Microsoft, it's a deal!

Oh, this is a sad day!
Probably there is no Nokia in future. It might be called Microsoft's mobile unit...

As a Finn, I'm so sorry.