Näytetään tekstit, joissa on tunniste 3D. Näytä kaikki tekstit
Näytetään tekstit, joissa on tunniste 3D. Näytä kaikki tekstit

torstai 21. toukokuuta 2015

We made this virtual reconstruction in 2006 about the Church of Oulainen. The animation was made for an exhibition. I'm not sure why I didn't publish this earlier. But anyway, here it is!


lauantai 20. huhtikuuta 2013

3D verkossa ilman lisäosia (WebGL + X3DOM + Javascript)


Reaaliaikaisten 3D-materiaalien käyttö verkossa on tähän asti vaatinut erilaisten lisäosien asennusta. Tämä on ollut äärimmäisen kömpelöä sekä harvoin alustariippumatonta. Lisäksi erilaiset suljetut formaatit ovat asettaneet sisällöt vaaraan. Digitaalisen kulttuuriperinnön näkökulmasta tärkeää on, että työtä ei tehdä turhaan eikä aineistoja kadoteta sitä mukaa kun kaupallisten tuotteiden tuki lakkaa.

Uusimmat selaimet (Microsoftin selainta lukuunottamatta) eivät enää välttämättä tarvitse laajennuksia kolmiulotteisen sisällön näyttämiseen. WebGL:n avulla selain voi käyttää hyväkseen 3D-näytönohjaimen ominaisuuksia suoraan.

Tekniikka itsessään ei vielä tietenkään vielä riitä. Malli täytyy saada näkymään tässä formaatissa ja siihen pitää lisätä tietoja ja mahdollisesti interaktiivisuutta. X3D on standardoitu XML-formaatti 3D-materiaaleille ja X3DOM on javascript-kirjasto, jonka avulla X3D-tiedostoja voidaan kääntää WebGL:n ymmärtämään muotoon.


Petäjäveden vanhan kirkon virtuaalirekonstruktio X3DOM-versiona.

Tein yksinkertaisen demon, jossa käytin aikaisemmin tekemääni Petäjäveden vanhan kirkon mallia. Malli on tallennettu X3D-formaattiin Blenderissä eikä sitä ole käsin muokattu. Koska 3D-objektit ovat osa normaalia DOM-rakennetta, pääsee niihin käsiksi kuten verkkosivun elementteihinkin. Tämä tietysti edellyttää, että mallintaja on ollut johdonmukainen objektien nimeämisessä. Esimerkiksi kaikki ikkunat voidaan helposti piilottaa, jos ne on nimetty "ikkuna_2", "ikkuna_3" ja niin edelleen. Nyt tarvitsee vain etsiä kohteet, joiden alussa on sana "ikkuna" ja asettaa niiden renderointi pois päältä.

Kokeilun pohjalta X3DOM vaikuttaa erinomaiselta lähestymistavalta. Se yhdistää standardin formaatin viimeisimpään selainteknologiaan. Mallit ovat turvassa vaikka javascript ja WebGL tulevat katoamaan ennemmin tai myöhemmin.

Demo löytyy täältä:
http://opendimension.org/reconstructions/petajavesi/



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.