Halaman

Kamis, 29 Maret 2012

Win7: Virus cause the folders to be hidden

Yep, a virus attacked my USB drive, it hide the folders, and replace them to a link which execute the naughty virus, using AV program, i manage to clean the virus, now the problem would be removing hidden attribute on the hidden folder..

I manage to enter the hidden folder using the path, but right-clicking and entering the properties doesn't allow me to change the hidden attribute for the folder

Fortunately, i come across this post here is a step by step guide :

  1. Open your command prompt, enter your path, as for my case it's H:
  2. run the command "attrib /s /d -r -s -h" without the double quotes
  3. wait for it..
A little explanation from the original author :
  • /s apply the command to all files
  • /d apply the command to all folders
  • -h will clear the hidden attribute
  • -s will clear the system file attribute
  • -r will clear the read only attribute
Hope this helps someone ;)

Rabu, 28 Maret 2012

c++: Boost "Bind" and "Functions" snippet

This is a personal note on using the boost library, since i come from a Delphi background, been trying to figure out the callback method which is simple to use in c++.. and then i come across useful boost library functions.. well the code should tell you more.. so here is the snippet :
//Using bind with Boost.Function
class button
{
public:

    boost::function onClick;
};

class player
{
public:

    void play();
    void stop();
};

button playButton, stopButton;
player thePlayer;

void connect()
{
    playButton.onClick = boost::bind(&player::play, &thePlayer);
    stopButton.onClick = boost::bind(&player::stop, &thePlayer);
}

pretty neat doesn't it? :)

Selasa, 27 Maret 2012

3d: Rotations, Axes, Local Space, Parent Space, World Space

The biggest factor i need to overcome with 3d programming was the math-side of 3d programming, there are many terms, such as vector, matrix, gimbals, local space, world space, projections, quaternions, euclidean, eulers etc.. We need to understand those terms so that i could position my objects correctly

If you are like me, you will be thrilled to read this page : opengl transforms, great article, made me understand the concept of local space and the world space

If you work with 3dsmax, blender, autocad, lightwave, etc you will likely works with axes, you use this axes to translate, rotate, scale your models, even per-element base(vertices, faces, polygons, edges).

There is a concept which helps me a lot to program transformation, and that is the local axes, the forward, up, and left axes which is locally for our object. If you put your matrix data using OpenGL conventions (column major) and you save your transformation to your object, then the elements :

  • local-x (default 1,0,0) would be (m0, m1, m2) 
  • local-y (default 0,1,0) would be (m4, m5, m6)
  • local-z (default 0,0,1) would be (m8, m9, m10)
  • and your object translation would be (m12, m13, m14)

But remember this matrix represents your modelview (that is your model matrix * view matrix)
okayh, now, what is this model matrix, and view matrix?

Rabu, 21 Maret 2012

Cygwin Note: Accessing your local drive

cygwin is a project where you will feel the linux-like environment, you could compile using makefiles using the command make..

This is a note to my self, to access your drive, type cd cygdrive/e/...
nice..

Minggu, 18 Maret 2012

ProtonSDK: Having trouble with the 2d coordinates?

Err.. this post would be some kind of my own personal notes..

I had trouble tracking the TouchHandler component, there's something that i could not understand, why does when we setup the screen to become 320(width) * 420(height) - in pixels, when i click on the bottom of the screen, the point interpreted by TouchHandler component is larger than 420..

Tracking through the source code, i found that we should be cautious when choosing the video mode, locked landscape, setup fake screen procedures

You could trace that problem on file "RenderUtils.cpp" the procedure "ConvertCoordinatesIfRequired" .. this would be a good place for your breakpoints :)

You haven't tried ProtonSDK? developed by Seth. A. Robinson - www.protonsdk.com try them! they are free and powerful!

If you stumbled across problems, there is the IRC channel, and the forum.. the creator (Seth) actively maintains and answer your question..

Kudos to you Seth! ;)

Owkayh.. untill next time

Senin, 12 Maret 2012

Exporting Blender file(Collada) for Irrlicht

I'm using the built-in Collada exporter for the time being, and i have never face any trouble of doing so

For those of you who are like me, which is a beginner to blender, this guide might help you a bit :)
  1. When you export a model and load it from your Irrlicht Project, but it did not show the dimension (width, height, length bounding box aabb) which you designed, go back to blender, try to open up the transform panel (using the n key on your blender's 3d view), check if you have a rotation / scale which is applied at the object level? if yes,press ctrl+a and apply those transformation
  2. Dunno if i'm doing this right, but to compose your scene, you need to benchmark / do a repeat trial to compose(positioning, scaling, targeting) your scene, your camera, etc 
  3. You need to assign material(s) and texture(s) if you need to colorize / make something out of that 'clay' look.. 
There is this one thread which gives a good general guideline exporting your 3d model to irrlicht.. i think i had it..

ah yes, here it is :

**** Source : Irrlicht Forum

posted by Mel :

Basically, whatever you export from 3DSMAX (it may be extended to other software as well):
  • It should be either an editable mesh or editable poly without modifiers. You should collapse the stack of modifiers. At most, the only modifier supported is the skin modifier, for skinned objects. 
  • It should be a single object, as it will be loaded as a single object by the engine. For instance, the wheels and the body of a car should be 2 different exported objects. 
  • place the object, so its pivot is on the origin of coordinates. Again, to export a wheel correctly, it should have the origin of coordinates at the center. 
  • Use at most 2 channels of UVW mapping coordinates, and make sure that the exporter will write both correctly. For this is good that you understand how to use the unwrap uvw modifier. And for most models, use just one channel of mapping coordinates, The usage of 2 channels is more for the stage models. 
  • Vertex colors are supported by irrlicht, and they help a lot, learn how to use the vertex paint utilities. -Use square textures with power of 2 resolutions, or at least, textures whose dimensions are power of 2. (1024x1024, 512x1024, 64x256...) 
  • Use the least material ID's posible, those translate almost directly into meshbuffers, you want to have the least meshbuffers posible. -
  • Skinned objects are supported, Use Skin instead of Physique, not that physique won't work, but the Skin modifier behaves closer to what Irrlicht does. And export just a single skinned mesh. Irrlicht only supports displacement mapping via geometry shaders, and those are only supported in Open GL,discard the modifier or collapse the mesh, and export the high resolution object. 
And that more or less, sums up all the precautions you should take when exporting models from max or other packages.

********** Ent of Message *********

Hmm.. do i need to add something more.. i will post when found something useful hehehe that's a promise.. i guess.. Err... i wanted to make a game, yet i stumbled learning things, let's enjoy the ride shall we?