markyparky56 wrote:
fanofcena wrote:
[b] THE CODE FOR THE 3d Render (coded by me ofcourse)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script language="JavaScript"> var ctx; var FocalLength = 300; function init() { ctx = document.getElementById("canvas").getContext('2d'); ctx.clearRect(0,0,800,600); } function dubplet(x,y) { } function triplet(x,y,z) { this.X = x; this.Y = y; this.Z = z; } var Rotation = new triplet(0,0,0); var Origin = new triplet(0,0,-30); function vertex(x,y,z) { this.x = x; this.y = y; this.z = z; this.rotate = function (){ //Rotation On Y Axis sin = Math.sin(Rotation.Y); cos = Math.cos(Rotation.Y); Ax = this.x*cos + this.z*sin; Ay = this.y; Az = this.z*cos -this.x*sin; //Rotation On X Axis sin = Math.sin(Rotation.X); cos = Math.cos(Rotation.X); Bx = Ax; By = Ay*cos + Az*sin; Bz = Az*cos - Ay*sin; // Rotation on Z axis sin = Math.sin(Rotation.Z); cos = Math.cos(Rotation.Z); Sx = Bx*cos + By*sin; Sy = By*cos -Bx*sin; Sz = Bz; var Rp = new triplet(Sx,Sy,Sz); return Rp; } } a = new vertex(50,50,0); b = new vertex(-50,50,0); d = new vertex(50,-50,0); c = new vertex(-50,-50,0); function Face(a,b,c,d) { this.A = a; this.B = b; this.C = c; this.D = d; this.Render= function() { ctx.beginPath(); var verts = []; verts[0]= this.A.rotate(); verts[1] = this.B.rotate(); verts[2] = this.C.rotate(); verts[3] = this.D.rotate(); sfr = FocalLength / (FocalLength + verts[0].Z); x= verts[0].X*sfr; y= verts[0].Y*sfr; ctx.moveTo(x+400,300-y); for (var i = 1; i <4; i++) { sfr = FocalLength / (FocalLength + verts[i].Z); x= verts[i].X*sfr; y= verts[i].Y*sfr; ctx.lineTo(x+400,300-y); } ctx.closePath(); ctx.fill(); } } var NewFace =new Face(a,b,c,d); function Cycle() { ctx.clearRect(0,0,800,600); Rotation.X += 0.12; Rotation.Y += 0.12; Rotation.Z += 0.12; NewFace.Render(); setTimeout(Cycle,10); } </script> </head> <body onload="init();Cycle();"> <canvas id = "canvas" height="600" width="800"> Oink </canvas> </body> </html>So you don't need someone to code it for you then?
Nopes but if som1 does then that would be appreciated cuz then we will have a choice from which engine to choose from
Offline
*facepalm*
whoops i forgot the make a task list
heres it
markyparky56,bbbeb ,ssss - try to Learn how .x format (Direct X) format saves data ! so that we can use .x models in game (trust me that saves lots of efforts and work)
DingDong - Please some music ! and textures!!
NercoMaster - some steel plate textures please!
Last edited by fanofcena (2011-04-30 12:25:07)
Offline
fanofcena wrote:
*facepalm*
whoops i forgot the make a task list
heres it
markyparky56,bbbeb ,ssss - try to Learn how .x format (Direct X) format saves data ! so that we can use .x models in game (trust me that saves lots of efforts and work)
DingDong - Please some music ! and textures!!
NercoMaster - some steel plate textures please!
Okay, I'll get on it.
*salute*
Offline
fanofcena wrote:
*facepalm*
whoops i forgot the make a task list
heres it
markyparky56,bbbeb ,ssss - try to Learn how .x format (Direct X) format saves data ! so that we can use .x models in game (trust me that saves lots of efforts and work)
DingDong - Please some music ! and textures!!
NercoMaster - some steel plate textures please!
Steel plate textures... Coming up! Also I can convert SKP to .x, so yeah.
Here you are:
It looks a little wood like though...
Last edited by Necromaster (2011-04-30 13:33:10)
Offline
in the corner it says "1f***0
Offline
The collision detected on some of the blocks (or whatever you canc all them) doesn't always work.
Offline
markyparky56 wrote:
The collision detected on some of the blocks (or whatever you canc all them) doesn't always work.
yeah i want to fix it
well actually , I am writing a whole 3d renderer rahter then raycaster for b8r graphics and gameplay
TOUGH but EPIC WHEN DONE!!
So you guys vote on this:
RayCaster (which has high benifits of speed and is OUTDATED (hey was used in DOOM) )
Renderer (Which has benifits of quality , images rendered looks nearly photo realastic)
darkCASTER ( my algorithm which is partial renderer - partial raycaster so has benifits of speed and good(NOT great) graphics)
Last edited by fanofcena (2011-05-01 11:24:22)
Offline
fanofcena wrote:
puppetadventurer wrote:
in the corner it says "1f***0
what ?????? WHERE??????!
now it says "//"
Offline
1. I see the // aswell, might just be a glitch with the new Mozilla Firefox though.
2. How did you encrypt the source code?
Offline
markyparky56 wrote:
1. I see the // aswell, might just be a glitch with the new Mozilla Firefox though.
2. How did you encrypt the source code?
easy its in binary format (x . u can google with : HtML source code encryptor and u will find a good one for u
Last edited by fanofcena (2011-05-02 07:24:01)
Offline
@MarkyParky : this is the 2d version of the RASTER raycaster technique we have been using so far : http://darkyen.webs.com/2Drcast.htm (its easier to find bugs in 2d right ? )
Offline
fanofcena wrote:
@MarkyParky : this is the 2d version of the RASTER raycaster technique we have been using so far : http://darkyen.webs.com/2Drcast.htm (its easier to find bugs in 2d right ? )
In theory yes.
Offline
http://scratch.mit.edu/forums/viewtopic.php?pid=750359#p750359 < O btw thats how my full 3d javaScript renderer works ( Its a link to my scratch project
) i made a 3d renderer with Z - sorting and Efficient rendering in Scratch 8-)
Last edited by fanofcena (2011-05-02 11:25:01)
Offline
Not really... just got exams comng up, so busy with revision, plus I can't find anything understandable about reading DirectX files... and no examples of it.
Offline
markyparky56 wrote:
Not really... just got exams comng up
+1 (AP Tests, and the semester exams of those AP classes)
But I'm still listening, just don't expect helpful input from me.
Last edited by MoreGamesNow (2011-05-03 19:53:47)
Offline
fanofcena wrote:
LOL i have NOOOOOOOOOO MOREEEEEEEEEEE EXAMSSSSSSSS!!! (other ten the SAT)
Meh... I've still got three more years, then uni.
Offline
So do you like my metal? I worked hard on it, and I got grounded.
Offline