Skip to main content.
May 31st, 2005

A four dimensional router ?

Very tired here. I’ve been going to sleep at 3AM again. Getting late (this morning 9 minutes !) to work. Sad.. tonight I must really focus and go to sleep at 2.
Yesterday was a rather stressful day. I had an animated phone conversation for the lamest of the reasons: ….ahh whatever !

Recently, I’ve upgraded my PC’s RAM to 1GB. Things seem much better now, but I need to test with video editing.. something that I gave up on doing when I had only 512.
Today I managed to close the long parenthesis that I opened while developing that 3D church thing. The M4D module is more or less working. The new file format is up. I’ve also simplified the triangle strips organization. Before, M3D had a list of strips to be optimized at load time for either PC based rendering or PS2 based rendering. On PC it’s convenient to make a big contiguous strip with degenerated triangles, on PS2 one can use the vertex-kick flag to restart strips.
I don’t have the PS2 kit anymore and both Xbox 360 and PS3 basically have PC’s graphics.. so, I’m just going for the contiguous strip in M4D, making the job easier for the renderer, which can use the data as is without re-processing.

Back to the church, next, I have to implement a mouse navigation system (mouse + keyboard, like Quake). This is needed because my sister will have to try it on her laptop and she doesn’t have the PS/PS2’s dual-stick interface.
After this, I’m really not sure what I will do. I want to put shadows in it. Shadows are the biggest issue. The church has no top, so I’m going to simulate sunlight, which implies hard edged shadows. That means that I either have to maniacally recursively tesselate the model, or I have to do a first shadow casting pass in world space. Have a shadow volume cut sharp the model, making sure to minimize the cuts. In the attempt to get this done, I’ll be dealing with M4D. All the polygon cutting and shuffling will push me to review the geometry database design or, in the best case, to add several functions to simplify this sort of operations.
Basically, it’s a lot more like writing a 3D engine for a 3D modeler rather than for a game.

On a completely different issue: the backup router that I’m using is a pain. It’s all in Japanese and I’m not sure if I have to find an option to make it work properly or if I have to disable its firewall altogether and use a software one for the time being.
My problem is that to make FTP work it’s not enough to have just the port 21 open. The router still has to be somewhat "intelligent" and sniff the traffic to open some extra random ports that are required for file transfers.
Now.. perhaps this old router has such feature.. but finding it in Japanese is going to be quite a challenge !

woo !

Posted by Davide Pasca as Uncategorized at 11:50 PM EDT

8 Comments »

May 29th, 2005

And we report again

The evening started with a gathering of friends. Some nice girls. Hopefully we’ll meet again. A phone number was taken.. we’ll see.
Then, I and another friend went to a club. Guess who I met there.. once again the “Minna kakkou ii” girl and her friend. I saw them switch a few guys. At one point I heard her saying “dou shiyou ?” [What should we do ?]. I can only guess what she meant 8)
My friend picked some girl. She brought her friend, which danced with me, but eventually met another girl-friend and got dragged away. It seemed to me like a cheap excuse to get away from me.. woooo ! An ugly girl that needs an excuse to get away from me ? Geez.. I’m only entertaining you to make my friend happy while he’s busy with your friend that has a "confused" smile.
Eventually I decided to go back home. My friend is busy and disappeared with the thing, I’m here tired and not really motivated. I take a taxi to go home. Half way home, I get a call from my friend: "Where are you ?! I asked the girl to go to my home all four of us and she said yes !!!". My answer: "Her friend ran away from me.. she’s ugly too. On a situation like that, I’m expecting her to get on her knees and give me a blow job ! I’m not going to stick around waiting for two ugly girls !". Of course, it’s not like I’m really into the business of getting BJs from any woman, but that reflects my state of mind. Truly, I wasn’t born to beg after dumb women that should rather beg after me. I’m not a famous TV star because I’m better 8) Any ugly woman so dumb to let me go, doesn’t deserve a slice of my time.. which is better employed at research and development.. of useful things, not lame copulation that anyone can do.
See you, dear ugly woman.. see you when you come ask for my autograph !

Posted by Davide Pasca as Uncategorized at 3:54 AM EDT

9 Comments »

May 27th, 2005

Lack of sleep and lack of network

This morning I woke up at 9:45. I naturally wake up at that time when I’m late for work (my alarm is at 8:50). I took half day off (till 1PM) and slept more or less what I needed to.
The night before I went to sleep again at 3AM, plus I went to the gym. Basically very tired !
When I woke up again at 11:30 I found a bad surprise: the router, a Linksys WRT54G, was dead.
I was tempted to go buy a new one after work, but instead I came home and tried fix it following some hints found on the net. Of course it didn’t work. I even opened the thing.. bha. Eventually I settled for using a backup router that I had laying around. Not so easy.. I couldnt find a power adapter that work work for it !
Luckily, I found one that seems to work although it gives 1A instead of specified max of 1.5A. Of course after I did have to spend some time to manage to log-in and setup the Internet connection. I didn’t have the manual, plus the interface is in Japanese.
Now everything seems OK. But eventually I’ll need to buy a new router.. although in the settings I may have fixed the connection timeout problem that I had before with it and that made me buy a new one.

Anyhow, yesterday night, after posting, I went to look for color space infos. I’ve been using YUV (specifically YCrCb) for a long time without quite realizing that it was still playing with RGB color channels. Y is basically a gray produced mostly out of green, Cr a difference mostly in red and Cb same but for blue.
This is the format used for JPEG, MPEG, etc. It comes from the TV standard of encoding image data, but I don’t think it’s the best color space to work for image compression.
A lossy YCrCb signal can bring out some serious visible artifacts if Cr and Cb aren’t compressed equally well.
One has Y (the gray image) that needs high quality and Cr and Cb that need to be compressed so that loss of information happens in a similar fashion. Basically, if with RGB one must be very careful because those are all primary channels. With YCrCb one has more freedom to compress channels separately, but not total freedom, because the Cr and Cb channels must still keep a good correspondence.
This brings me to think that I should try work in a different color space, one that still has 3 channels, but 3 channels that can be compressed independently without bringing out major color artifacts (for the human eye).
The ideal color space should be something that separate the gray scale image component, a basic color palette (a hue) and a saturation for the color. If saturation is bad, the color is still faithful, it doesn’t shift towards red or blue like YCrCb.

Now it’s time to sleep, but I’m happy to know that I have a good direction in which to move now.

zzzzzzzzzzzzzzz

Posted by Davide Pasca as Uncategorized at 2:47 AM EDT

No Comments »

May 26th, 2005

Destructive doubts

I’m stuck ! I’ve been wanting to add color to the video-chat test app, but I can’t seem to focus and decide how to do it.
I want to do something clever. I’m already compressing the luminance (gray level image) at relatively high quality. To compress the remaining two color components without utilizing the similarities with the luminance it would be a crime. At the same time, it’s not easy to just write code for an algorithm without even a source of inspiration.
If I don’t come up with something clever, I’m bound to force the data size to sensibly grow, or have poor quality. This doesn’t particularly make me happy. On the other hand, black and white images really suck 8)
The truth is that I should sit down and start making experiments. Compression is all about statistics and statistics is all about inspecting data. In all honesty, I’m not sure how chrominance components are distribuited, therefore I can’t really come up with something good.

Doubt is probably the number one killer for productivity !

Posted by Davide Pasca as Uncategorized at 2:21 AM EDT

6 Comments »

May 25th, 2005

Some people code, some people watch F1 races !

Today is my mother’s birthday !
For her birthday, she decided to take a vacation. ..All by herself, since my sister was busy with school. Right now she’s in Nice in France, but Sunday she was in Monaco to watch the F1 race by the starting line ! She went there and bargained for a last minute ticket to the race. Quite adventurous, for someone that speaks Italian and "shopping English". Comes to show how often just takes the will to do things.
A good lesson for me, since I’m one of those that drags his ass to do anything.
Anyhow, she said that seeing the race live was very exciting… just as I was told before !
I guess this year I really must go watch the Yokohama race !

Changing subject, today I completed the first version of m4d. The C+ (one plus) version of m3d. I also decided to dump new and delete. The reason is that it’s much easier to handle objects when they all have a common father. Also, it doesn’t make sense that OOP, which pushes hierarchy so much, ends up allocating all objects in the same domain !
A scene now contains an array of (scene’s) objects and each object contains an array of groups. That is, one pointer the actual array of data, not an array of pointers.
This way I have a direct relationship between a pointer and an index. The memory allocation is compact, no need to allocate hundreds of single objects, plus the array to track them.
I’ve also finished the converter from the 3DS format into m4d. Plus I’ve written a new flexible file format.
The new format is mostly "human readable". Because it doesn’t make much sense to scroll trough thousands of lines of floating point vertices, I decided that vertex data should be compacted by being printed out as 32 bit hexadecimal values and by putting several vertices on the same line.
The final look of the bulk data is a bit like MIME encoded binary data used for e-mail attachments.
This allows me to keep the format readable, easy to parse, but minimize the bulk.

Posted by Davide Pasca as Uncategorized at 12:07 AM EDT

No Comments »

May 24th, 2005

C++ adventures into the land of method’s calling

Monday, back to work. Whole day very focused on some major code rewrite. Something I started Friday.
I have this M3D module that I use for handling 3D at the data-base level (no rendering, although I wrote some PC renderers that use M3D). Basically I use this library to handle basic geometry. Vertices with color, skinning, texture, normals. Triangles and strips. making strips, converting strips back to triangles, removing unused materials, sort the data as to remove state changes for rendering. Also some experiments on mesh complexity reduction and so on.
Basically it’s the interface that I use to handle parsed data from file formats like XSI and 3DS.
For this rewrite I wanted to try and approach C++. It’s actually an experiment in itself. For the time being, my main concern with C++ is writing style more than performance, as I think I can already handle performance well enough.
My current style is base dont he following rules, that I need to verify with time.

Let’s say I have an scene, an object and a group. For every scene there are N objects and for every object there are M groups. A group is practically a 3D mesh. So, an object is a collection of meshes (plus other things that I’ll leave out for now).
In M3D, I have m3d_object_t, m3d_scene_t and so on. Functions have prefixes that indicate their scope. They are basically like C++ methods. So, functions that operate on m3d_object_t structure will all start with m3d_object_. For example: m3d_object_scale( m3d_object_t *op ). For the scene then it’s m3d_scene_scale( m3d_scene_t *sp ).
And here start the troubles with C++. m3d_object_scale( op ) would become op->scale(), m3d_scene_scale( sp ) becomes sp->scale( sp ). And so on for groups and all the rest.
Now, while this is neat, at the practical level, it turns a nightmare when I need to find out exactly where in any piece of code I scale the scene or I scale an object. This is especially important for libraries such as this, that are used by a number of different programs.
My current solution is to use a shorter prefix. So, for the class m4d_scene_c I have sp->m4s_scale(). m4d is the library name, m4s stands for an m4d Scene.
This allows me to keep track of where I scale a scene, an object or a group.

Then it comes the issue of the private methods and additional modules. For private methods, it’s probably OK to lose the prefix. They aren’t supposed to be used externally anyway. I’m still not sure though.
In any case, C++ forces to have a lot of private methods, some have a specific domain and some sort of prefix is still probably useful.
Let’s say that I have a separate CPP file for welding close vertices of a group. In the file I will put the m4g_weldverts() method, but also some private functions. In C i would declare those static and forget about them. In C++ I need to declare them into the class, so it can get a bit more confusing.
The solution for now is to use some sort of prefix. In this case, a function that is strictly used by the m4d_weldverts() would be called, for example, weldverts_flag_weldable_verts(). Basically with the weldverts_ prefix.

Still, I sort of hate the idea of having to declare the private methods, but we’ll see how it goes.

It’s almost 3AM.. zzzzzzzzzzzzz

Posted by Davide Pasca as Uncategorized at 2:56 AM EDT

6 Comments »

May 23rd, 2005

皆格好いい - minna kakkouii - they’re all cute !

Not a productive weekend at all. Somewhat trapped into going out both Friday and Saturday night till late in the morning. Club this, club that. Lots of people, "friends" that secretly try to sneak phone numbers and date girls to which I’m clearly interested in. Au au au ! What some people wouldn’t do over pride. Must have all women, must be number one, me better than you, me model, you ugly, me me me. Not even worth confronting people about it. Better to play cool and slowly withdrawal my contribution to the friendship. Considering that I’m generally more altruistic, I’d say that there is a good chance that the person that decides to hurt the friendship will end up with the biggest loss. There is clearly something wrong when you do your best to boost an egocentric person’s morale and he jumps on a woman around you.
This has happened more than once recently. I can see how one is tempted. To some extent, I’ve also sometimes been struggling trying to accommodate friendship and women. But I think that I generally do a better job. If one really can’t help it, at least being transparent and avoiding girls for which your friend has an active interest in, are two good starting points.

Speaking of girls, here comes the topic of the post: I was in a club and I see two attractive girls in front of me. They were just arrived, both seemed pretty excited. One nervously biting her nails, says: “minna kakkouii !” (they are all cute !).
That’s how normally guys are known to think, but it’s also how younger girls think. It’s only natural. Of course the difference comes to when one has to get closer to someone: will a girl get close to a guy just because he too is cute, or will she use a more appropriate meter ?
I looked at them and I said: “watashi mo ?” (me too ?). “Yes, you too !” ..yeah right !
I asked them if they were looking for something in particular, men, women !
Anyhow it was fun. At least those girls didn’t pretend to be something else. They were straightforward and friendly.

Posted by Davide Pasca as Uncategorized at 2:02 AM EDT

3 Comments »

May 21st, 2005

Small town Tokyo

Yesterday, night I went out with some friends. One came to Japan for work and he is my guest these days. Two nights ago we were going for dinner in the Shibuya area. While walking around we met another Italian friend with his Italian girlfriend. He met her because he met another old friend that recently came from Rome, by pure chance while walking two weeks ago. All four of us went to a restaurant.. and there I met an old coworker of mine !
This is only a small portion of all the coincidences happening. I’m in the middle of Tokyo and I keep bumping into people that I know, or even Italians that I don’t know but end up becoming close friends.

Sometimes one is waiting at a train station to meet some friends, and suddenly can hear girls screaming UAAAAAAA !!!!!!!!!
Those are girls that meet again by chance. It happens all the time !!
I guess that in the end, people tend hang around the same places. Especially if one is waiting outside a train station. It’s like a car stalling in the middle of a crossroad.. a collision is bound to happen.
Statistically it’s probably nothing special, but practically, people feel like destiny makes them meet. And that’s… cool !

Posted by Davide Pasca as Uncategorized at 3:28 PM EDT

No Comments »

May 17th, 2005

Frequency domain’s dreams and normals’ tidying

Yesterday (Monday) night I dreamed that the World was reconfigured to work in frequency domain as opposed to time domain !!
This brought some changes. It all started with a centered white spot, plus some extra spots. A bit like when one visualizes an image that has been transformed with the FFT (Fast Fourier Transform).
It was mostly like seeing a cheap sci-fi movie. Not really interesting from a purely scientific point of view. Still, it was a clever dream to have in a sense 8)

I did more research about reading 3DS objects with faces being properly ordered.. and found out that I wasn’t doing anything wrong. The problem is that AutoCAD’s exported files have no sense of faces’ orientation. In order to render those objects properly, one has to render them with faces as having two sides.
That requires some extra rendering time, but also prevents from properly creating smooth vertex normals !
So, I wrote some code to fix the faces normals. The code works on the assumption that objects are closed. For each face, there must be a corresponding one that covers it. With that assumption and lots of ray-tracing activity, I can give the proper orientation to the faces. There are however a few exceptions 8(
Instead of trying to analyze the exceptions, I decided to manually fix those last few faces. The next step is to write an exporter to a common 3D object format (AC3D seems good), so that I can import the processed objects in Blender, modify the faces’ orientation by hand and then export the final objects. Hopefully by tomorrow I can finish that (yeah, right !).

More things to do: continue my mother’s website. I’ve been looking around for a simple BBS script, and it seems that only Japanese care to make simple BBS scripts. I’m planning to download one of those and adapt it to English/Italian.

Finally, I’ll also need to complete the first release of the video-chat app. Dind’t do any work in that sense. Although today I read some docs about neural networks applied to image compression. Interesting stuff, but I don’t know enough about neural networks to even start experimenting.. plus, that’s definitely a distraction, something diametrically opposed to the goal of releasing a working program 8)

Posted by Davide Pasca as Programming, 3D Graphics at 2:38 AM EDT

8 Comments »

May 15th, 2005

Antialiased fonts, Subversion and normals

I never quite understood why Windows’ fonts would be anti-aliased only at large sizes. It doesnt take much to do some basic anti-aliasing. Render a character at double the size, shrink it to the required size with an average filtering, and there is the smooth looking character. In any case, recently I’ve seen several screen shots on the web, where Windows XP’s fonts looked pretty smooth. Eventually I did a web search and I found out that the ClearType font rendering, was actually available on XP, not just on Pocket PC (Windows for PDAs). I downloaded the ClearType PowerToy and after a short while I was already looking at anti-aliased fonts.
ClearType does some extra clever smoothing for LCD monitors, where red green and blue sub-pixels are nicely distributed each taking exactly one third of a whole pixel.
This is not a new thing. Adobe Acrobat Reader has been doing it, Apple MacOS X on LCD displays has also been doing it. Microsoft of course claims some special recipe that apparently gives it the top quality. I’m not sure where the top quality level is, but I’m definitely much happier now !

Changing topic, I’ve successfully installed and started the Subversion server on my home-server. Now I can work on code at work and find the same changes at home and vice versa. Very handy, although the available GUI clients on Windows aren’t as good as WinCVS for CVS. Still, I’m quite happy.
It seems that nowadays one couldn’t live anymore without Open Source software !!

On the 3D side, I’ve been looking for 3D objects on the net, but everyone wants people to pay for any half decent object (..so much for the Open Source efforts !). So, I asked help to my sister. She sent me a 3DS of a church that either she or her boyfriend made… her architecture studies are starting to become more and more useful from my point of view 8)
Unfortunately my 3DS parser seems to have problems detecting the proper face orientation. Now I’m in the middle of some fierce debugging. I hope to be done with this by today, or I can’t guarantee I’ll be able to grant me a good night of sleep… ummmm !

Posted by Davide Pasca as Uncategorized at 5:07 PM EDT

6 Comments »

« Previous Entries