flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > OS Construction > fool 3D

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 3937
Location: In an open world without walls and fences, we wouldn't need Windows and Gates
fool 3D
i recentlly refunded my old 3D_processing.rar (maybe the only time i used the .rar extension) code, in order to apply the fool structuration to every part of the 3D engine.

i had more advanced versions of the 3Dengine, but there were too much code inside to refactor it easy. then, i took the first version.

Image
now, i have a better code, that shows the way to do 3D render.

shortcuts:

Code:

qwerty
left clicQ=accelerate
right clicmiddle clicW=decelerate
E=toogle edges
D=toogle dots
S=link camera to the first star of the starfield
T=toogle triangles
O=toogle sincos method (fixed point or floating point)
P=toogle line method (with putpixel or direct)
L=toogle the 2D display
G=toogle palette (default or flashy)

home=return to the initial camera position. Smile

mouse motion counterupdownleftrightrotate the camera.

esc=exit



enjoy, but it is a bit frustrating to don't have more than that for the moment.
look at the version number, no number for the moment cause it should be integrated to the 2D fool interface as a simple set of 3D functions.
You are not allowed to download the files attached to this post. You may need to log in in order to do so.

_________________
ImageImage


Last edited by edfed on 18 Mar 2012, 21:54; edited 1 time in total
Post 04 Mar 2012, 21:37
View user's profile Send private message Visit poster's website Reply with quote
Coty



Joined: 17 May 2010
Posts: 468
Location: ␀
This is great, thanks, I'll have to take it apart and mess with it Very Happy

_________________
http://codercat.org/
Post 08 Mar 2012, 19:57
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1564
Location: web
Thanks edfed.
Post 08 Mar 2012, 21:26
View user's profile Send private message Reply with quote
pabloreda



Joined: 24 Jan 2007
Posts: 53
Location: Argentina
nice lib edfed...
I have a implementation in fixed point..perhaps you can use something
sin and cos aproximation in 16.16 (i try loockup table and this is best)

http://code.google.com/p/reda4/source/browse/trunk/r4/Lib/math.txt

if you need this in asm tell me and I traslate for you
Post 09 Mar 2012, 00:16
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1564
Location: web
Hi pabloreda.
I have not seen you around for some time, how is reda4 going ?.
Post 09 Mar 2012, 03:34
View user's profile Send private message Reply with quote
pabloreda



Joined: 24 Jan 2007
Posts: 53
Location: Argentina
Hi dex.
Near of optimizer compiler, I notice here when I get ready !!
Post 09 Mar 2012, 11:56
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 5287
Location: Kraków, Poland
Looks a bit like Elite/Frontier to me. Smile
Post 09 Mar 2012, 12:12
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 3937
Location: In an open world without walls and fences, we wouldn't need Windows and Gates

pabloreda wrote:
nice lib edfed...
I have a implementation in fixed point..perhaps you can use something
sin and cos aproximation in 16.16 (i try loockup table and this is best)

http://code.google.com/p/reda4/source/browse/trunk/r4/Lib/math.txt

if you need this in asm tell me and I traslate for you



it is still in fixed point. 24:8 with 24 part =0, and 8 part as fractional part of 1.

it is the maximum i can use to do 32 bits fixed point for 3D.

with 16:16, i will be limited to 65536 3Dpitch depth. what is like just smaller than the 'incal.inc' model. then, not good at all cause we'll never see the stars. or maybe do a 16:16 for near, and 24:8 for far. hem... no, floating point for everybody. Smile

i will make it floating point. it is the only good way to do 3D computations.

using the floatting point, even if limited in resolution, will let play with really huge scenes.
32bits fp will be enough for the begining. using sse would improve a lot performance. especially when it will do matrix based 3D tranforms.

cause for now, there are no matrix for the 3D transform, just 2 vectors. translation, and rotation, and only the translation here is reccursive.
that's why objects cannot rotate. only the camera rotation is taken in account.

about this rotation, i think a rotate container will be an acceptable solution.
then, to rotate an object, just use a rot3D, like put3D tranlate.

the rot3D function is still there, but it don't works as wanted.

in this model, the nested transforms are simple.
in theory, add the angles components of the item and the camera. then, use this angle to rotate the translation component of the item, before to add it to the camera position. and it should work.
but don't wor, when i tryed it, the object effectivelly rotates, but in another dimension. lol. it is just a mistake, one day, it will work, maybe with the first digit based version number .

thanks all.

_________________
ImageImage
Post 11 Mar 2012, 15:39
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2012, Tomasz Grysztar.