This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#76 2011-04-29 05:44:01

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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  big_smile


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#77 2011-04-29 06:35:41

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

Bump!


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#78 2011-04-30 12:24:16

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

*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)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#79 2011-04-30 12:53:29

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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.  wink  *salute*


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#80 2011-04-30 13:26:00

Necromaster
Scratcher
Registered: 2010-04-07
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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.  smile

Here you are:

http://img828.imageshack.us/img828/5277/steeltext.jpg

It looks a little wood like though...  hmm

Last edited by Necromaster (2011-04-30 13:33:10)

Offline

 

#81 2011-04-30 13:42:35

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

in the corner it says "1f***0


3

Offline

 

#82 2011-04-30 16:40:34

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

The collision detected on some of the blocks (or whatever you canc all them) doesn't always work.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#83 2011-05-01 11:19:11

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

puppetadventurer wrote:

in the corner it says "1f***0

what ?????? WHERE??????!


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#84 2011-05-01 11:21:33

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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  sad  well actually , I am writing a whole 3d renderer rahter then raycaster for b8r graphics and gameplay  wink  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)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#85 2011-05-01 12:42:16

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

fanofcena wrote:

puppetadventurer wrote:

in the corner it says "1f***0

what ?????? WHERE??????!

now it says "//"


3

Offline

 

#86 2011-05-02 00:39:33

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

*scratches head* oink something wrong with ur CSS Clipper


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#87 2011-05-02 06:05:03

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

1. I see the // aswell, might just be a glitch with the new Mozilla Firefox though.

2. How did you encrypt the source code?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#88 2011-05-02 07:19:44

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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  wink

Last edited by fanofcena (2011-05-02 07:24:01)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#89 2011-05-02 09:43:32

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

@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 ? )


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#90 2011-05-02 11:09:37

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#91 2011-05-02 11:24:46

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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  big_smile   big_smile  ) i made a 3d renderer with Z - sorting and Efficient rendering in Scratch 8-)

Last edited by fanofcena (2011-05-02 11:25:01)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#92 2011-05-03 12:00:01

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

lost intrest??????????????


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#93 2011-05-03 16:52:21

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#94 2011-05-03 19:53:14

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

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)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#95 2011-05-04 00:50:35

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

LOL i have NOOOOOOOOOO MOREEEEEEEEEEE EXAMSSSSSSSS!!! (other ten the SAT)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#96 2011-05-04 08:47:07

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

fanofcena wrote:

LOL i have NOOOOOOOOOO MOREEEEEEEEEEE EXAMSSSSSSSS!!! (other ten the SAT)

Meh... I've still got three more years, then uni.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#97 2011-05-08 17:24:55

Necromaster
Scratcher
Registered: 2010-04-07
Posts: 1000+

Re: Going 3d !! anyone wanna join in ????

So do you like my metal? I worked hard on it, and I got grounded.  sad

Offline

 

Board footer