05
Mar
09

Pause

van gogh

Once again, I’m putting the blog aside, because of college work. I hope I can continue to learn blender on my next vacations. I’m planning to buy some new tools to improve my design abilities. I also intend to keep in touch with Blender, since I’ll try to apply for Google Summer of Code this year.

That’s it! See you soon!

(the picture is a Van Gogh’s work: Noon: Rest from Work (after Millet) )

22
Feb
09

Game in Javascript

memo

A year ago or later I was learning Javascript, PHP and a little about AJAX. I created many simple Javascript codes, but at the time I thought they were too naive. But I also remembered that I’ve written a simple memorization game, like those that came with windows 95, or something like that.

It is still simple, but I liked to play a little with it, so I decided to add it to my homepage. It is in portuguese, but the gameplay is very easy and so playable by anyone. It can be accessed from: http://www.students.ic.unicamp.br/~ra036668/projetos/jogo_memoria/

21
Feb
09

Modeling trees

I read a post in Allan Brito blog about modeling tress and how 3dmax has a plugin to generate trees models [1]. I researched web a little about the subject and found Arbaro [2], a tree generator written in java which exports models in pov ray format (.pov) and wavefront (.obj). Fortunately blender reads .obj format and I could import the trees. The sofware has a lot of examples and parameters to play with, but I didn’t spend much time on it.

tree

You can download it in any SO with compatible java version. The only problem I had was due to the outdated manual, which tells to type:

java -jar arbaros_gui.jar

For graphical interface and:

java -jar arbaro.jar -p pov/quaking_aspen.pov -o \
pov/quaking_aspen.inc trees/quaking_aspen.xml

for command-line execution. But the actual filenames are arbaros.jar instead of arbaros_gui.jar and arbaros_cmd.jar instead of arbaros.jar.

Reference:
[1] Criando uma árvore com subdivisão no blender 3d (pt)
[2] Arbaro – tree generation for povray

21
Feb
09

Broken PC

Tonight my computer died. I think the source have overheated and the computer stopped working. I’m so lucky, to have my pc broken in the begining of “carnaval” (a holiday week)… I’m not sure when I’ll have it back. I’ve stored there all my models in blender and every other files I was working with.

Well, I had backup copies in my pen drive, but guess what: I just bought a new pen drive and was transfering the data from the old pen drive to the new one. I had only time to move from my old pen drive to a temporary folder in my pc. (Lesson: just remove a safe copy after you are sure the transfer was done).

To complete, I also can’t access my university account through ssh due to server maintenance. Funny how bad things usually happen almost in the same time.

I’ve reactivated my old computer, but everithing is in a mess. I have at least four copies of linux installed here and also windows 98. Tomorrow I’ll try to get a new source and maybe install lastest kubuntu.

19
Feb
09

Texture Mapping

After a while I’ve finally returned to my Blender studies. I’ve been busy with academic stuff, but I now remade my schedule and now I have more time for my hobbies.

Texture mapping is a nice way to apply textures to complex objects (like human head). The idea is to turn the surface of the object planar and then apply an image as texture.

I followed a simple tutorial and made an even simpler object to test what I’ve learned.

tex

I created a simple texture image in Gimp from a random image if found on web.

texture

Reference:
[1] UV Mapping and Texturing
[2] UV Unwrapping

04
Feb
09

Python Learning

I’ve been busy the last three days practicing python. My primary interest in python was to be able to code for blender. I was told it was the best way to enter blender’s developers world.

After reading some tutorials on web, I decided to start programming. My first attempt was to use SPOJ [1] to practice, since most of the problems avaiable there may be submited in any language. The main difficult in training there is that problems generally have limited time to execute. I know there’s a way to optmize python execution, but I thought I needed to start low.

euler

I don’t know how I’ve found this site: http://projecteuler.net/, but I discovered it was very suitable for my purposes. First of all, you can program in any language (or none at all), since you just need to send the answer, not the program. Secondly, for the same reason, time is not mandatory, even if it takes python three times more than C to run, I won’t bother to wait that much.

Another advantage to use python to solve the problems in that site is that python have many third-party libraries that are much easier to include than in C/C++. By the way, I found it very useful the scypy library. Also, in python you don’t have to declare variables and define their types and python has a built-in support for arbitrary precision integers. This combination makes a problem like “Find the sum of the digits of 35^100″, a trivial task.

Python data structures are also very very good. The new great concept python introduces is Lists [2]. This is a very intuitive way to manage data. I’ve also used some structures common to C++ STL, like sets [3]. The recently released python 2.6 provides a new data structure: Fractions, which implements rational numbers.

I’ve been coding python under windows using Netbeans IDE 6.5 which now supports python development. I have nothing to complain about this tool.

Python is a great language and I think it’s fun to program. The most part of what I’ve learned comes from the references below. But I think that it’s not enough to read all python materials and tutorials: practice is essencial! I hope that describing my first steps in learning python I may help anyone willing to do the same.

References:
[1] Sphere Online Judge
[2] An Introduction to Python Lists
[3] sets — Unordered collections of unique elements
[4] The Python Tutorial

28
Jan
09

Room 7

New version of the room. I remade the chair, using some new technics (now it has 5 legs as the real one).

room7

27
Jan
09

Google Sketchup

Google Sketchup is a 3d modeling program specially designed from architectural projects.

I’ve heard about this software from Google before, but only now I had time to download and test it. I’ve watched some tutorials and just learned how to draw a chair.

chair

It’s known that Google Skecthup is good for modeling, but not for texturing. So, I decided to export my simple chair to Blender. It took me sometime to find out how to “sucessfully” do it.

First of all, I used the most recent version of Blender (2.48a), Python (2.5) and Sketchup (7.08657). Then I exported my chair through : File > Export > 3D Model… and saved with .kmz extension.

Now, you have to rename the extension to .zip and extract it. One of the items extracted is a folder named ‘models’. There you’ll find a filename with extension .dae. Now open blender and go to Import > COLLADA 1.4 … and import the .dae file.

So far so good, but when I tried to export my simple chair it could not import the legs and the cilinders correctly. It creates empties instead. I don’t intend to spend more time learning this tool by now, but it’s always good to learn new stuff.

26
Jan
09

Allan Brito and Lux Render

I’ve been busy with my college work, but I think this week I’ll have more time. The only things I could do since the last post was read Allan Brito’s blog and test Lux Render [4].

I’d like to highlight two posts of his blog.

One is about modeling using subdivision [1]. There is a link to some tutorials, in spanish, using the software Modo [2]. They tell that there are three types of modeling: using NURBS, hard surface modeling and subdivision. I’ve been working with the second one, with little experience with the first. I found the tutorials quite advanced. Furthermore, Blender lacks some of the tools or characteristis of Modo, for example, binary operation like intersection, union and difference can only be applied for objects with volume, so an operation between a plane and a circle won’t work (correctly).

The other interesting post was a tutorial from Allan Brito himself, the modeling of a Barcelona Chair [3]. It seems complicate at first sight but he uses some tricks that turns the job easier. Unfortunately the tutorial is divided into parts and he just published the first one yet.

Last, I couldn’t get good results from Lux Render yet. The good aspect of this renderer is that it shows the whole image while rendering, while Blender internal just shows the image when the render is done. The following image is the result of the Barcelona’s Chair tutorial, rendered with Lux Render:


chair
[click to enlarge]

Reference:
[1] Modelagem 3d por subdivisão [Portuguese]
[2] Técnicas y trucos modelado por subdivisión [Spanish]
[3] Tutorial: Criando uma cadeira Barcelona [Portuguese]
[4] Lux Renderw

18
Jan
09

Rounded Corners and Shadow Borders for Websites

Well, there are a lot of ways to design rounded corners sites using CSS. But I always missed some that provided a tutorial to draw the borders. So I decided to draw my own using gimp.

I use this layout for my current college page,

homepage

First, let’s open a new file in Gimp: File > New…
Choose a width so that it is larger than the width of your page. The height can be like 400px.
In advanced options, change to Fill with: Transparency.

(There was an image here, but Imageshack seems to have lost it)

We now use the “Rectangle Select Tool” (the first icon at the main panel). Check the option “Rounded Corners” and choose a suitable radius, say ‘25.0′, like the image below (nicely marked in red):
page2

Draw a rectangle with the size almost the same as the image, then go to Edit > Fill with FG Color (you can change this color by clicking at the small rectangle just below the icons in the main panel). I used a red FG color to get this:
page3

Next, go to Filters > Light and Shadow > Drop Shadow…
If you want shadow borders in both sides, you have to set offsets to ‘0′. You can play with the other parameters or leave them with default values, just like I did:

page4

Click OK. It was created a shadow around the rectangle. Maybe it’s difficult to see it because of the transparent background, but you can verify it opening the Layers Panel:
Go to Dialogs > Layers (alternatively type Ctrl+L)

We have two layers, one of them named ‘Drop Shadow’ (left image below). Before starting cropping, we shall merge these layers: just right click in the ‘Drop Shadow’ layer and choose ‘Merge Down’. We’ll get the image at the right below:

page5

Now, with the “Rectangle Select tool” (you may uncheck the ‘Rounded Corners’ option), select the bottom of the rectangle (more or less at the height where the corner ends). Copy it and open a new image with transparent background. Its size can be the same of our current image. Paste the selection there:

page6

This will be the bottom of the web site. But as we don’t know the actual size of the site, we need to split up the left and right corners. Using my CSS model, we need the left side to include the border and at the right we just need the corner. So, let’s cut the right corner from this image. Unselect the current image by clicking away from it and again using the ‘Rectangle Select Tool’, select the right corner and cut it. Again, create a new transparent backgrounded image with any sufficiently large size and paste the corner there. Now, let’s correct the size of these images. In both of them go to:
Image > Auto-crop Image…

Save them as “bottom_right.png” and “bottom_left.png” (jpeg format won’t preserve transparency). Well, we have our “bottom_right” and “bottom_left” parts.The process for obtaining the upper parts is the same, but for my CSS tutorial they won’t be necessary. We just need to get the lateral shadows. For this, go back to the rectangle image and select a small part of the left border (just the shadow), like I did below:

page7

Copy it and open in a new image (transparent background as always). Auto-crop it again and save as “top_left.png”. Now, simply go to:
Image > Transform > Rotate 180°
and save the resulting image as “top_right.png”.

Let’s go to the code!
The example I tested the generated borders has the following structure:

HTML code:
http://pastebin.com/f1e91e89f (wordpress won’t let me paste html code here?)


/* CSS Code */

.bottom_left {
background:
url(bottom_left.png)
top left no-repeat;

margin-right: 54px; /* Controls the length of the bottom */
padding-bottom: 30px; /* Parameter */
}
.bottom_right {
height: 30px;
background:
url(bottom_right.png)
top right no-repeat;
margin-right: -55px; /* Controls the distance between the left and right bottom parts */
padding-bottom: 30px; /* Parameter */
}
.top_left {
background:
url(top_left.png)
bottom left;
background-repeat:repeat-y;
}
.top_right {
background:
url(top_right.png)
top right;
background-repeat:repeat-y;
}
.container {
margin: 0 auto;
margin-top: -10px;
width: 900px;
}

.text {
margin-right: 12px; /* Parameter */
margin-left: 12px; /* Parameter */
background-color: green;
padding: 25px;
}

Put all these files and those images in the same directory and test all parameters until you get the desired result. I put a green background on purpose to show where we have the border.

page