3D engine by MihaiG Ver. 1.0
Author |
Message |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Fri Oct 31, 2008 3:05 pm Post subject: 3D engine by MihaiG Ver. 1.0 |
|
|
Hey guys,
ive been working on this 3d engine for the past 3-5 days or so, I've only attached an exe and one model (i hope you like the model )
i decided to post this release since its a fairly big improvement in terms of speed, I've reduced some doubling errors which occurred with the previous build.
so far this version is autonomous and requires no user interaction since my current controls are sketchy to say the least.
Features that i plan to have in the final release version
are
rotation of object on every axis
shifting x,y,z(zooming)
i am currently working on zsorting it's about 70% done i have minor bug fixes to work out
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
3d engine-udt.rar |
Filesize: |
289.85 KB |
Downloaded: |
296 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
metachief
![](http://compsci.ca/v3/uploads/user_avatars/59969875948ed1e6be9fb0.jpg)
|
Posted: Fri Oct 31, 2008 3:17 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
How do you make your file that you load everything from: "mc.ply"? Is there a special program that calculates the coordinates of each line that you have and puts them in a text document or what? I opened it with notepad and all I saw was a lot of numbers... I'm confused.
|
|
|
|
|
![](images/spacer.gif) |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Fri Oct 31, 2008 3:30 pm Post subject: Re: 3D engine by MihaiG Ver. 1.0 |
|
|
well *deep breath*
basically..
master chief is just a bunch of triangles (well call em' polygons for now)
the file essentially stores each polygon,
imagine a polygon is defined by
the following vertices
V1,V2,V3
V1 = (x1,y1,z1)
V2 = .... etc
so the data is stored as
x1 y1 z1 x2 y2 z2 x3 y3 z3 for polygon 1 and that repeats essentially
so each polygon has 9 points of data attributed to it.
to make the actual master chief
i made a model in blender(well i found this one on the internet) edited to remove excess polygons or extra verticies, made sure everything was stored as a polygon. and i exported the model in the raw format, (so it only stores the location of each vertex no colour data or anything else, and then i just modified that file a bit.
i then wrote a seperate program(not too had to do )that calculates the number of polygons and i insert that at the front of the file, so the program knows how much memory to allocate for polygons
this is the largest model that i have tried 2030 polygons, i have a 1500, 968, 513 and a 4 models,
the 968 and the 513 both run nicely and smoothly, while anything above runs with some delay
i dont recommend that you run this program in linux(via wine) or windows if your computer is more than 2-3 years old considering its current 'efficiency' status
**************EDIT***************
i decided to post the code for the polycounter program, that determines the number of polygons from a raw data file
code: |
var fileNo : int
open : fileNo, "filename.ply", get
var polycount : string
var counter : int := 0
loop
exit when eof (fileNo)
get : fileNo, polycount
counter += 1
end loop
put counter/9
|
also thanks to saad who i stole his quick_sort code from which will be used in the next release, and thanks to nick who made an fps counter(which i removed due to some displaying errors [i will fix it i promise...] )
i hope to add decent mouse rotating support, saad saw one of my early beta's of that with my first iteration of the engine he replied 'wee'
hopefully i can improve stuff radically as i have jotted down some ideas to imrove efficiency
Regards
_mihai_
|
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Fri Oct 31, 2008 4:06 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
I noticed yo used 'eof', which I assume means 'end of file'. Is there a command to read until the end of the line? This would be very useful for my programming team (just formed today, started preparing for the next DWITE and CCC)
|
|
|
|
|
![](images/spacer.gif) |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Fri Oct 31, 2008 4:30 pm Post subject: Re: 3D engine by MihaiG Ver. 1.0 |
|
|
doing something like
get : fileNo, <value> : *
grabs till the end of line ( i think)
|
|
|
|
|
![](images/spacer.gif) |
Nick
![](http://compsci.ca/v3/uploads/user_avatars/19644337547e837b41d67a.png)
|
Posted: Fri Oct 31, 2008 5:15 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
you're correct Mihai, also a :* would be useful in your program so you won't need to divide by 9 in the end
|
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Fri Oct 31, 2008 5:48 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Thanks, I would like to download & try your program, unfortunately my .rar decompresser trial ran out and I have yet to find a free mac one.
|
|
|
|
|
![](images/spacer.gif) |
metachief
![](http://compsci.ca/v3/uploads/user_avatars/59969875948ed1e6be9fb0.jpg)
|
Posted: Fri Oct 31, 2008 10:12 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Thanks MihaiG, that was very helpful. I'm tired of raycating and wanted to start putting 3d models into my games so thanks for that, now I know where to begin at least. By the way, do you know any tutorials on 3d?
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Fri Oct 31, 2008 11:52 pm Post subject: Re: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Nick @ Fri Oct 31, 2008 6:15 pm wrote: you're correct Mihai, also a :* would be useful in your program so you won't need to divide by 9 in the end
no it wouldnt because my files are technically one complete line so if i would grab the whole thing i would just be grabbing a realllllllly long string which would probably break,
by grabbing one by one i can ensure that i am not missing any vertices (ie a decimal number)
|
|
|
|
|
![](images/spacer.gif) |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Fri Oct 31, 2008 11:55 pm Post subject: Re: 3D engine by MihaiG Ver. 1.0 |
|
|
would let me attach a file in edit mode... :shrug:
***************edit**************
i have attached a copy of the program in zip format
i have also added bonus models, note.. you need to rename them to mc.ply for it to work, but it should work
also make sure you have the polygon count at the beginning of the program if not, you can use my program shown above to do the calculation
regards,
mihaig
ps. meta chief
nope i dont know any, most of this was done purely on intuition and some prying questions now and then on irc, your best bet is to first start of with rotating points in 2d, then in 3d, then start implmenting polygon rotation/rendering, also make sure you switch form a 2d-3d rotation matrix when doing stuff in 3d, cause... i forgot to and by doing so i fixed some speed issues
http://www.fastgraph.com/makegames/3drotation/
is really neat informative page
note some knowledge in math is required for the best understanding of the material covered
http://mathworld.wolfram.com/RotationMatrix.html is also VERY useful, but i suggest starting with 2d and learning about matrices before you get into 3d, learn to optimize code, it helps ^^
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
3d engine-udt.zip |
Filesize: |
386.07 KB |
Downloaded: |
253 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
metachief
![](http://compsci.ca/v3/uploads/user_avatars/59969875948ed1e6be9fb0.jpg)
|
Posted: Sat Nov 01, 2008 7:23 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Thank you... have a lot of work now!
|
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Wed Dec 10, 2008 4:27 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Just tried it out for the first time, and I have to say, that is very good. Me likes! There are a few glitches, though that may be because I'm running it through crossover.
|
|
|
|
|
![](images/spacer.gif) |
MihaiG
![](http://compsci.ca/v3/uploads/user_avatars/2070081168483773c3dead4.png)
|
Posted: Wed Dec 10, 2008 7:14 pm Post subject: Re: 3D engine by MihaiG Ver. 1.0 |
|
|
there is an updated the source code in another post, there was no need to necro this topic since it is older and no code is listed
|
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Wed Dec 10, 2008 7:17 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Oops, went here to get the models, forgot to go back to the new thread.
|
|
|
|
|
![](images/spacer.gif) |
Saad
![](http://compsci.ca/v3/uploads/user_avatars/182387547249e7ebb91fb8a.png)
|
Posted: Wed Dec 10, 2008 7:18 pm Post subject: RE:3D engine by MihaiG Ver. 1.0 |
|
|
Locked by request of OP, new version of topic is can be found here
|
|
|
|
|
![](images/spacer.gif) |
|
|