I am thinking about redoing the design on this site, making it a bit more aesthetically pleasing. I am thinking about adding a couple more features as well, this includes nicer code preview, featured posts, nicer design, logo, better categories and easier navigation. I have been making some assets for the new page and wanted to share it with you.
Notification icon
Success icon
Warning Icon
Error icon
They archive contains the images in .PNG format and has sizes from 32x32 to 512x512. As always, feel free to use them however you please.
Ever in need of more than just the standard abbr tooltip? A little while back I wrote just that. It can easily be made prettier, but it works as intended. What this does is listening for the mouseover and mouseout events and display a div with absolute positioning at the element's location with the tooltip text.
To add tooltips, the syntax would be like this:
<ahref="#"class="tooltip" data-title="Tooltip title" data-content="Tooltip text">The text you want tooltipped</a>
The JavaScript code that does the work looks like this. As you can see, the listeners are registered and when the mouse hovers the element, it gets the data-title and data-content attributes from the <a> element.
$(document).ready(function(){
$('a.tooltip').mouseover(function(e){ var title = $(this).attr('data-title'); var content = $(this).attr('data-content');
Just a quick notice: The articles has now been listed for your convenience. The complete list can be found here.
On another note, I have been very busy with my master thesis, but I will get to posting the article on line intersection shortly as well as give you the complete source code for a working example on a very effective 2D collision detection algorithm. Just need to optimize the line generation and limiting the search space for the line intersection. In other words: making it even faster!
This function draws a line between p1 and p2, using the texture defined(yes, it needs to be a texture). The Color.White in the function, just specifies the clear color. I post this now, as it can be used with the upcoming how-to: Line intersection.
As you might have noticed in the video in my earlier post, the bounding box of the sprite is scaling based on the rotation. This is useful as it ensures that even if the content is rotated, it is always within the bounds of the rectangle. To illustrate this, take a look at the following photos:
A 6 by 6 square without rotation
The same 6 by 6 square, but now rotated by 45 degrees
When we rotate the blue square, its bounds increases to the square in green. This is what we are trying to compensate for. The following formula gives us the delta x and y from the origin point.
The formula that gives us delta x and y
Using this formula, we find that dx' = 4.24 and dy' = 4.24. Please note that this formula will work for any sizes, I'm just using a square for simplicity. By applying this to code, we get the following in C#:
I have been helping a friend of mine with a way of doing quick 2D collision detection in XNA. One of the common problems with collision detection in 2D is when you rotate it. Most functions do pixel perfect collisions by parsing the whole images, as it can be tricky to get the correct pixels to compare with each other when you rotate the image. Modifying the texture itself is way too slow and should be avoided at all costs and I feel the same about checking every pixel.
My solution parses the texture beforehand, generating either bounding lines or a line grid above the texture. When this is used with rectangle intersections as well, before doing the fine tests, it runs both fast and precise. The resolution of the lines can easily be specified for each texture and they work no matter what resolution you might use.
I'll get around to posting both the math and the code (when I get it cleaned up), but for now: here is a preview of the working concept.
Not much up today. Usually just working on my master thesis, it is coming along but I am lagging a bit behind. Should be able to finish it in time though. Today: LCS and trying to improve my skills with inkscape.
As I always want to expand my skills, this time I am looking into 3D modelling. It is a real nuisance that there are so few good 3D artists so I want to be able to make some of my own. I have been playing around with Blender as an alternative to 3D Studio Max. This is mainly because I can not use my 3DS license to create content that is going to be sold. This is the first result of a simple coffee cup.
I just completed Tomb Raider yesterday in a single day, thought that I should share it with you all. It is a really nice game, it has everything Tomb Raider should have: action, tombs and Lara Croft. The graphics are beautiful, the scenery is really immense and the story line is compelling! I would really recommend anyone that has the slightest interest in Tomb Raider to try it out.
The last Tomb Raider game came in 2003 (not counting the spin off) so it has been a long 10 year wait. Has it been worth it? In a word: YES!
This time around we are brought back to the origins of Lara. The story starts off on an expedition for finding an ancient civilization with a 21 year old Lara. After being caught off in a storm, they are stranded on an island in the "Dragon Triangle" where Lara gets separated from the group, kidnapped by a crazy native.
Tomb Raider play through part 1:
The player interaction is very fluent and even if there is a large open-ish world, there are very few glitches. This open world style often results in a lot of weird control issues as there is too much content for the developers to hammer them all out, but Square Enix has done a good job here.