Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » Article Discussions

Discuss the articles posted on Dev.Opera.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By jseidelin anchor Friday, 28. November 2008, 10:39:37

Creating pseudo 3D games with HTML 5 canvas

Jacob Seidelin from nihilogic.dk has a lot of exciting tricks up his sleeve, with regards to creating games using HTML 5 <canvas>. This week we are lucky enough to have him sharing some of his techniques with us, in the shape of some code for creating pseudo-3D first person perspective games using canvas and raycasting.

( Read the article )

By FataL anchor Friday, 28. November 2008, 21:38:28

avatarGreat article, thanks!
I have posted it to Digg and Reddit!

By lui1999 anchor Saturday, 29. November 2008, 03:13:25

avatarhow create a widget?

By p01 O anchor Saturday, 29. November 2008, 14:44:28

avatardev.opera.com : creating your first opera widget

By DesertDawg anchor Sunday, 30. November 2008, 20:00:29

avatar ...<abr title="field of vision">FOVabbr. - Needs fixin - Noticed when corrected it doesn't underline with dashes.

Fortunately, this feature can be disabled in opera:config under "Multimedia".


"config:opera" only shows the following 3 for Multimedia (v9.62):
Always load favicon
Play Background Sound
Show Animation <- ?????

Post edited Sunday, 30. November 2008, 20:11:00

By chrismills O anchor Sunday, 30. November 2008, 23:01:02

avatarCheers DesertDawg - I've made fixes.

By jseidelin anchor Monday, 1. December 2008, 08:11:31

avatarDesertDawg: That's odd, I wonder if they removed the option? I still have it in my 9.60. Will try upgrading.

By jseidelin anchor Monday, 1. December 2008, 14:28:55

avatarNope, still there. I've no idea why you don't have the interpolation option.

By rupakrajguru anchor Thursday, 4. December 2008, 06:11:51

avatar

Originally posted by jseidelin:

Jacob Seidelin from nihilogic.dk has a lot of exciting tricks up his sleeve, with regards to creating games using HTML 5 <canvas>. This week we are lucky enough to have him sharing some of his techniques with us, in the shape of some code for creating pseudo-3D first person perspective games using canvas and raycasting.

( Read the article )




Hi ..sorry new to the forum and opera .. cld somebody tell me how to event key board events for opera in javascript .. i have no clue on this.. thanks ..

By georgianamorton anchor Thursday, 4. December 2008, 21:34:23

avatarA very useful article, especially for those who like me are currently engage in creating 3D games and presentations. I was digging into the subject for quite some time and this article was just what I needed to sort come doubts out. Thanks! :smile:

By geekrecon anchor Friday, 12. December 2008, 01:02:44

avatarVery interesting article

I've been working on similar projects for a while now and am beginning work on normal-mapping textured triangles using a canvas. I'm sure the final product will be very slow, but it's a learning experience. I've already worked on texture-mapping, real-time shading, shadow-mapping, ray-tracing, z-sorting, and a few other graphical techniques. Here are some widgets of what I've made so far:
http://widgets.opera.com/author/geekrecon/

And my website for Opera-centric projects, targeted at the Wii:
http://wiioperasdk.com

I'd like to share some ideas. Tangent128 is another individual who hangs around Opera's website creating projects like these. Maybe we could all code something since three heads are better than one.

By Drakim anchor Sunday, 28. December 2008, 01:07:18

avatarI'm working on an engine based on this raycasting technique, which includes some nice eye candy effects like shading based on light sources.

What bothers me greatly though is the lack of floor textures. As much as I try to bend my mind around the problem, I just can't come up with a way to make floor tiles, simply because they would need to rotate as you rotate, to retain their texture pattern with the correct facing. Since JavaScript can't rotate images without canvas, we are out of luck.

Still, even one colored div floors would be better than nothing, since you could at least have different colors at diffrent places (right now the whole world has a gray floor in the demo), but I'm unsure how to make something like that. Any ideas?

By jseidelin anchor Sunday, 28. December 2008, 13:29:06

avatarYes, floors are a problem and you won't get very far without rotation. I suppose it would be possible to have single colored zones with a bit of math and some horizontal divs, although I'm not sure of the specific details of how to implement it (yet).

@geekrecon: Nice stuff! I'll have to check out Tangent128 as well.

By PartnerTeam anchor Wednesday, 8. July 2009, 13:45:48

avatarWonderful code that i'm currently porting to Java. It works nicely.
Just wanted to report an error in the code inlined in the article :


The castRays() function is called once per game cycle after the rest of the game logic. Next comes the actual ray casting as described above.

function castSingleRay(rayAngle) {
// make sure the angle is between 0 and 360 degrees
rayAngle %= twoPI;
if (rayAngle > 0) rayAngle += twoPI;



.. should be (and in fact IS corect in the downloaded code) :

if (rayAngle < 0) rayAngle += twoPI;

(I have had strange behaviour with the green ray because of that).

By Rooter78 anchor Sunday, 12. July 2009, 21:14:51

avatarHi

I found a small error in the article: In the chapter Opera and image interpolation you recommend to "uncheck Show Animation" but it sure should read "uncheck Interpolate Images". :wink:

Rooter

Moderators: pepelsbey | dstorey | mcx | operadev | chrismills | shwetankdixit | brucelawson | iheni | andreasbovens | zibin | mollydotcom