Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Thuvs"s 3D Engine Demo
Index -> Programming, Turing -> Turing Submissions
Goto page Previous  1, 2, 3  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
zylum




PostPosted: Wed May 02, 2007 9:40 am   Post subject: Re: Thuvs"s 3D Engine Demo

very nice though 3 fps is a bit impractical. i doubt you will be able to improve the frame rate enough to make it practical. if youre calculation for each pixel is relatively fast compared to the drawing of the pixel (ie just looking up an RGB value in memory) i have a method to improve the drawing speed though its a bit of a hack.
Sponsor
Sponsor
Sponsor
sponsor
DIIST




PostPosted: Wed May 02, 2007 12:21 pm   Post subject: Re: Thuvs"s 3D Engine Demo

program_x wrote:

WOOT!! star fox for SNES!! i beat it many times, but thats not the point. i like the lighting but i agree, is there any way to speed it up ?

4th Guy to say that. Its really a giant red Panda. Wink

zylum wrote:

very nice though 3 fps is a bit impractical. i doubt you will be able to improve the frame rate enough to make it practical. if youre calculation for each pixel is relatively fast compared to the drawing of the pixel (ie just looking up an RGB value in memory) i have a method to improve the drawing speed though its a bit of a hack.


I'm guessing the hack cant be posted, would be nice to increase the frame rate. The speed can increase with my program but its inconsistent. It jumps to 10fps then goes back to 3. Reason is I'm using fractals to texture and the depth of the fractals is all dependent on the object orientation, and angle. I'll post the code in a bit, but everything is all over the place and i have to organize it. + Document it
zylum




PostPosted: Wed May 02, 2007 11:25 pm   Post subject: RE:Thuvs"s 3D Engine Demo

its a hack in the sense that i draw using something that wasnt intended to be used for drawing.

basically i use the sizepic and takepic methods and the associated array as a buffer and draw to that then i output it all at once. though upon further testing it seems to be about as fast as offscreenonly Razz the advantage of my method though is that you can draw at what ever resolution you are rendering at and automatically draw it as full screen.

here is some example code. basically the buffer array stores the image in a sort of bitmap format so you might wanna read up on that. also i didnt really optimize the code so maybe you can speed that up (probably a lot).

code:
View.Set ("graphics:640;480,nobuttonbar")

const scale := 0.25

const x := round (maxx * scale)
const y := round (maxy * scale)

var b : array 1 .. sizepic (1, 1, x, y) of int

takepic (1, 1, x, y, b)
b (7) := 48
for i : 19 .. upper (b)
    b (i) := 0
end for

var id := 19
var n := 0
var t := Time.Elapsed

for j : 1 .. y
    for i : 1 .. x
        b (id)| = 255 * i * j div (x * y) shl n    %b
        if n < 24 then
            n += 8
        else
            n := 0
            id += 1
        end if

        b (id)| = 255 * i * j div (x * y) shl n     %g
        if n < 24 then
            n += 8
        else
            n := 0
            id += 1
        end if

        b (id)| = 255 * i * j div (x * y) shl n     %r
        if n < 24 then
            n += 8
        else
            n := 0
            id += 1
        end if
    end for
    if n > 0 then
        id += 1
        n := 0
    end if
end for

drawpic (0, 0, b, 1)

var p := Pic.New (1, 1, x, y)

Pic.Draw (Pic.Scale (p, maxx, maxy), 1, 1, picCopy)

put "Draw Time: ", Time.Elapsed - t, " Milliseconds"
DIIST




PostPosted: Thu May 03, 2007 4:06 pm   Post subject: Re: Thuvs"s 3D Engine Demo

Very usefull Smile but the way it going I'm probably just gonna make two engines, a rendering engine and a 3d engine.
Leave texture for the rendering engine, so you can expect lag.
DIIST




PostPosted: Sat May 05, 2007 12:05 pm   Post subject: Re: Thuvs"s 3D Engine Demo

Well heres the code for texturing on cubes. Didnt manage to get any further. The codes not organized but i eventuall do it Cool .


Turing Textures.zip
 Description:
It might not work for some computers.

Download
 Filename:  Turing Textures.zip
 Filesize:  63.03 KB
 Downloaded:  217 Time(s)

Wing_Wing




PostPosted: Sat May 26, 2007 7:18 pm   Post subject: Re: Thuvs"s 3D Engine Demo

After I just downloaded the file and ran it, I received an error:

I/O attempted on unopened stream number -10. Open failed with message 'File "C:\Users\Home\AppData\Local\Temp\Rar$Dl01\ship.seki" not found'.

or something like that. Ringing any bells?
Saad




PostPosted: Sat May 26, 2007 9:40 pm   Post subject: RE:Thuvs"s 3D Engine Demo

You ned to extract the files to a folder, else it wont work
Tallguy




PostPosted: Mon May 28, 2007 8:06 am   Post subject: RE:Thuvs"s 3D Engine Demo

sweet!!!!!!!!!!!!!!!!!!!!!!!!!!!!! so tripy
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Mon May 28, 2007 6:53 pm   Post subject: RE:Thuvs"s 3D Engine Demo

Wow. I wish I knew more about 3d graphics Sad. By the way what grade are you in?
DIIST




PostPosted: Mon May 28, 2007 8:44 pm   Post subject: Re: RE:Thuvs"s 3D Engine Demo

CodeMonkey2000 @ Mon May 28, 2007 6:53 pm wrote:
Wow. I wish I knew more about 3d graphics Sad. By the way what grade are you in?
I started out thing the way to solve a 3d problem was using a 3 dimensional array. I had weirder ideas than that too about 3d graphics. Currently I'am in grade 12 taking discrete math and geometry. Decided to test out what i learned. I usually just write my programs in turing cause its faster(an im used to it), but i know c and java and an assortment of other languages too. This was actually based off my original engine i built in grade 11, man has it improved after learning OOP. Laughing
CodeMonkey2000




PostPosted: Wed May 30, 2007 10:44 am   Post subject: RE:Thuvs"s 3D Engine Demo

I've been think about collision in 3d. You can still use 2d tile method of colliding for basic plat formers. Each height level checks from a different text map though. Or if you want a more precise method , imagine a sphere around your objects. You need incorperate Z into the equation: sqrt((deltaX)^2+(deltaY)^2). This equation will give you the distance between two objects. If the distance between the two polygons is greater than the sum of the radiis then *boom!* they collide, game over. Both of these methods are more efficient than the whatdot colour method, and this is important since 3d is slow in turing.
Tallguy




PostPosted: Wed May 30, 2007 11:28 am   Post subject: RE:Thuvs"s 3D Engine Demo

when i ran ur texture program i get a blank screen....i can't open any of ur files at all
DIIST




PostPosted: Wed May 30, 2007 11:44 am   Post subject: Re: Thuvs"s 3D Engine Demo

For some odd reason turing has a problem with setcolor if your on a win98 or lower environment. It works on the P3 xp computer at school. If you want ill post up the code that dosent use RGB.SetColor, but it wont have any lighting. As for the files, there not written in quads. Im currently working on newer engine, by the looks seems to be a lot faster with more improvements which will include texture for triangle mesh files. Probably release it in a month. Its going to take a while because i want to make a game with the engine to test its capabilities.
DIIST




PostPosted: Wed May 30, 2007 4:14 pm   Post subject: Re: RE:Thuvs"s 3D Engine Demo

CodeMonkey2000 @ Wed May 30, 2007 10:44 am wrote:
I've been think about collision in 3d. You can still use 2d tile method of colliding for basic plat formers. Each height level checks from a different text map though. Or if you want a more precise method , imagine a sphere around your objects. You need incorperate Z into the equation: sqrt((deltaX)^2+(deltaY)^2). This equation will give you the distance between two objects. If the distance between the two polygons is greater than the sum of the radiis then *boom!* they collide, game over. Both of these methods are more efficient than the what dot color method, and this is important since 3d is slow in turing.
Spherical collision would be the best for 3d but like the Perfect Circle Collision tut showed you have to take into the account that object may pass through one an another on two separate frames but still never collide. Solid Boxed collision could be better thought. With solid box collision you just compare the points of one objects collision box to see weither it is inside the collision box of another object. It is faster in the since that you are just using comparisons as opposed to actual calculations using math and the distance formula. You still have to worry about collision missing thought Sad ! As for the tile method it would be usefull if you make a 3drpg of any sort. It is possible, and i am considering creating tilemap support for my engine soon. It works like any other 2d tilemap but in 3d using heightmaps.
CodeMonkey2000




PostPosted: Wed May 30, 2007 4:25 pm   Post subject: RE:Thuvs"s 3D Engine Demo

I believe many games from the ps1/n64 era used the tile system. I know metal gear sold, crash bandicoot and spyro used the tile system. Many fps used raycasting along with a tile system (such as doom, wolfen Stien 3d, etc.). And the great thing about a tile system is that level editing is 10 times easier.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 3  [ 35 Posts ]
Goto page Previous  1, 2, 3  Next
Jump to:   


Style:  
Search: