Monday, November 12, 2012

Reading Vertices From a File and Some View Manipulation & Textures!

Okay, so my task for this week was to scan in vertices from a file and create a representation of that object. In the end, I need to be able to scan in a list of vertices of triangles and then create a model based on these. We're talking 70,000+ vertices here!

So, I used this tutorial: http://learningwebgl.com/blog/?p=1067

Which as you can see creates a little world that you can move around in if you follow the link and view the tutorial. I made my own file, vertices.txt, which contains the vertices of the pyramid (represented by 3 triangles, each represented by X, Y, and Z coordinates). I then took a Google image of water and instead of loading their "mudTexture" I changed it to "waterTexture."

Screen shots: 




In the pictures on the left you can see these are the same view on the X-Y but change the Z coordinate. The page up and page down keys allow the viewpoint to change on the Z axis.



This is similar to just looking up and down, but not turning your head left and right.



Here, I pressed the down arrow and moved backwards. The interaction of the "camera" is kind of like moving around in a video game!



Here is an up close view of the pyramid!








Attack of the Scruffdogs (my dog)!!


I've been messing around with the files with the vertices... here's what happens when I just draw the vertices:
Case Cutietta Vertices

Convento Dei Cappuccini Vertices

Mdina Cathdral Sacristine Vertices

I don't know what the actual cisterns look like so I'm not sure if this is representative of what they really are, but it is after all drawing the vertices in the file. Note: they all have the water gif as a texture, that is unrelated to the cisterns!

That's it for now, stay tuned for more posts!!

-Vanessa