March 01, 2006
GLArt #7- March 1st
Three matrixes that we use in GL:
PROJECTION - controls the 3d space/perspective or lack of perspective
MODELVIEW - controls the model/scene/placement of objects
VIEWPORT - where on the screen is the scene appearing/ "window"
(the process of using these matrixes is called PROJECTING)
PROJECTING - takes this scene that we created, and helps navigate in a scene (Z axis from 0 to 1) -> glu.gluproject() returns a result of the transformed point in space (from 1,0,0 to the actual openGL coordinates for instance: 500,20,83).
array picking method -> complex way to find the coordinates for mouse in the 3d space
getzdepthatorigin() - projects 0,0,0 (the origin) and gets back the projecting value of z (this is after the modeling,projection & viewport). We need to find the value of Z if we're gonna navigate according to the mouse position, so we get the projecting value (0-1) and can use that-> and if we want to keep our z constant, we can just keep that value.
ray-picking -> can calculate exact pixel which a light ray would hit a certain spot on the model. Find out more information about this - maybe some code which already dealt with this! Can make a model and use some organic/physical particle interaction (using IR?!)
Marshall Mcluhan book - "understanding media" (must read)
Vermeer - lighting in paintings
Charles Burchfield - watercolor, minimal natural lighting (look at the met)
video (talk to Chris K):
look at fractals (mandelbrot, julia)
gltextsubimage2d() - generates textures on the fly
gldrawpixels(), glreadpixels() - not h/w optimized, so better not used.
Posted by Gilad Lotan at 06:43 PM | Comments (0)
February 22, 2006
GLArt - Lesson #6
GLInteger()- to set how many bits to allocate to each stack. If we want to Push/Pop more, use GL_MAX_MODELVIEW_STACK_DEPTH to find out how big our stack is.
When modeling, a lot depends on the normals. If we want hard edges, and sharp hangles we need more normals.
.obj file from Maya - encoded in a .txt file. We get all the vertice (v), texture coordinates (vt), normals (vn) and faces.
Look into Display Lists in OpenGL - (GLART_6_displaylist example) - put anything that's not going to change in a displaylist. when re-using the same geometry, better to use a displaylist. For spheres its better.
Look at creating sockets (video sensing & networked objects)
H/W - think of something to do over two classes. Think ahead of time of an effect that you want to get to.
pixel-by-pixel
Posted by Gilad Lotan at 06:39 PM | Comments (0)
February 20, 2006
Flesh
Some interesting effects I managed to make this week with random shapes and colors, using textures from photos I took in Paris last spring.


The effect is nice, but not quite there yet. I want to somehow randomize the cube shapes, and to create something more organic.
Some effects I made with last week's assignment:



Posted by Gilad Lotan at 02:18 PM | Comments (0)
February 15, 2006
Lesson #5 - Texturing, 15.2.06
look at lwjgl documentation for mouse (functions to get mouse position).
Texturing has its own coordinate space in OpenGL. Images that are used for textures have to be powers of 2 (in size of length). The textures are stored in the GPU (graphics card)-> much faster. We need to map our texture space onto our model space.
lwjgl website - "devil" library - for optimized texture handling functions.
In OpenGL there is a need to flip the images.
In order to use alpha channels, we need to enable blending (GL11.glEnable(GL11.GL_BLEND)), and then define the GL11.glBlendFunc to set blending parameters.
- Zsort - sometimes we need to sort out the geometry ourselves (for z, depth), especially when dealing with alpha texures (in those cases when we need to turn off the automatic depth handling).
- MipMap - because of scaling up and down, we create a bunch of texture images from the biggest, smaller 4-5 steps and creates intermediate images. This makes the application look better.
* OpenGL renders lighting effects first, then texture, and this may dull the reflected highlights (specular), particularly affecting glossy materials. Use glLightModeli(GL12.GL_LIGHT_MODEL_COLOR_CONTROL, GL12.GL_SEPARATE_SPECULAR_COLOR) to have OpenGL render reflections after (on top of) the texture. (note: this is a 1.2 feature).
H/W:
Use materials & try Alpha.
Idea:
- create layers with peep-holes, where you can see into the other layers, depending on the movement of all the rest.
- different geometric shapes, each with parts of the body. Comes together every once in a while...
Posted by Gilad Lotan at 06:35 PM | Comments (0)
February 08, 2006
GLArt, Lesson #4 - Feb 8th, 2006
look at viewports in OpenGL - can adjust to different screens, as well as have a small window to work with (like a workspace).
Really great site for OpenGL functions
Really great site with all the geometry equations.
Types of light:
Emitted light originates from an object and is unaffected by any light sources.
The ambient component is the light from that source that's been scattered so much by the environment that its direction is impossible to determine - it seems to come from all directions. Backlighting in a room has a large ambient component, since most of the light that reaches your eye has bounced off many surfaces first.
Diffuse light comes from one direction, so it's brighter if it comes squarely down on a surface than if it barely glances off the surface. Once it hits a surface, however, it's scattered equally in all directions, so it appears equally bright, no matter where the eye is located.
Specular light comes from a particular direction, and it tends to bounce off the surface in a preferred direction. A well-collimated laser beam bouncing off a high-quality mirror produces almost 100 percent specular reflection. Shiny metal or plastic has a high specular component, and chalk or carpet has almost none => like shininess.
Usually we will create materials that don't reflect a certaing color (just reflect whichever color light hits them). We just need to set how shiny they are (specularity).
H/W - light a sphere above a ground plate. Get different effects (snowball, pooltable ball, mirror ball... etc). Have a grid for viewports (maybe 4 different balls on the screen). Look at Monet and other impressionist paintings.
Posted by Gilad Lotan at 07:36 PM | Comments (0)
February 07, 2006
GLArt - Geometric modeling
This site is really cool for planning the plot scheme of a certain model.
Trying to recap my linear algebra, and infinitisimal math. Functions I got so far:
- circle - sqrt(9-sqr(x)) and + sqrt(9-sqr(x)) - this gives a circle with radius=3 centered at the origin.
- petal shape - going to try to make a petal shape using the sqrt(x) function. Draw it once for x=1 to 30. Then rotate 90 CCW, then draw the -sqrt(x) function.
Posted by Gilad Lotan at 11:54 PM | Comments (0)
February 01, 2006
GLArt - Lesson #3, Feb. 1st 2006
GL11.glEnable(GL11.GL_CULL_FACE)
If a polygon is drawn counter-clockwise (vertices drawn in counter-clockwise order), then the front side is facing us (right hand rule). When we enable culling later on (to save processing power), the back side of the surface will be invisible.
Matrix multiplication is the basis of 3d activities. Every time we change a perspective, the matrix that represents "our world" changes. We need to multiply our matrix with the vertex (x,y,z) in order to get the new position for this same vertex. This creates an effect of 3d movement through space.
3 transformations that occur:
- Modelview Matrix - This matrix is formed when we make the actual 3d model.
- Projection Matrix - This matrix is formed in order to create a 2d picture of this 3d model (bring it to our eyes). Acts like the LENS of the camera we're looking from.
- Viewport Matrix - This matrix deals with the screen you're seeing from. How big is the screen, and how much do we want to see. Defines the area inside our application window (which opens up when we run the program) - we actually say which part will have the world that we build. We can make it in different aspect ratios as well. Use this when we need to display our project in a different screen (with different ratios).
GL11.glOrtho - creates a frustum - a 2d view of the scene centered at 0,0. We define the six clipping planes. Things don't get smaller as they're farther away. Almost like creating a perfectly straight box around our scene -> the world has no perspective -> things look 2D. In Ortho mode, things can still appear to look 3d (depending on our viepoint angle & distance), although there is no perspective (things stay the same size, all lines are straight).
Display.setVSyncEnabled(true) - every time you draw to the screen, synchronize it with the display refresh cycle (Hz). This runs faster because the program is not waiting for the monitor to refresh the screen. Fast, but tearing is visible (because its sometimes drawing as the video card is doing its' refresh - usually every 1/60th of a second).
To Do:
1. Go over matrix multiplication theory.
2. Try to get some code for serial connection through JAVA (sockets) in order to add some Pcomp options into GLArt projects this semester. Look at Dan'O 's link.
3. Read this article about linear perspective in the renaissance.
4. Look at the following projection tutorial.
Ideas:
1. connect breath to a visual display (using a microphone & PIC) - open a flower, or making a propellor turn (to get a machine flying).
2. connecting physical movement to the display - accelerometer / light sensor / video tracking?
Posted by Gilad Lotan at 06:57 PM | Comments (0)