flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > win3ds

Goto page 1, 2, 3  Next
Author
Thread Post new topic Reply to topic
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
I ported (partially) my view3ds app for MenuetOS. For now it support several displaying models, please use SPACE key for switching, also make random lights (use TAB) and zoom in/out (use +/- keys).
Until them, enjoy... Cool
http://macgub.vxm.pl/win/win3ds00.zip
Image


Last edited by macgub on 27 Feb 2018, 19:30; edited 1 time in total
Post 25 Jan 2013, 12:59
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
win3ds01 - I added several sse4.1 optimizations (using "pblendvb" instruction). When you haven't sse4.1 machine you can use sse2 version but it slower than completly unoptimized x86 code ("maskmovdqu" instruction I used to, operates on non temporal variables). I added viewing edges only drawing model, which plots smooth shaded wire-frame. All without OpenGL touching.
http://macgub.vxm.pl/win/win3ds01.zip


Last edited by macgub on 27 Feb 2018, 19:31; edited 1 time in total
Post 20 Feb 2013, 10:10
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1114
Location: Russian Federation
Niiicceee!!
Post 22 Feb 2013, 10:15
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
randall



Joined: 03 Dec 2011
Posts: 153
Location: Poland
Great work!

_________________
https://github.com/michal-z
Post 22 Feb 2013, 14:48
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Thanks guys for your opinions. Very Happy
Post 25 Feb 2013, 07:35
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Win3ds02. I added ability load external .3ds file. (App open dialog at start). I implemented on/off motion blur option (press F1 key) and play with float Zbuffer coordinates also using AVX instructions -> flat shading, last drawing model; but it decreases app speed Crying or Very sad

app:
http://macgub.vxm.pl/win/win3ds02.zip
a few 3ds objects:
http://macgub.vxm.pl/menuet/3ds_view/3ds_objects.tgz


Last edited by macgub on 27 Feb 2018, 19:32; edited 1 time in total
Post 11 Mar 2013, 11:38
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Win3ds03. I added new displaying models based on textured lines (Press space several times). Texture can be like in environment mapping or red-white stripes like in texture mapping displaying model). I added also predefined 3d model as an alternative to model loaded from file (switching beetwen models after hit F2).
http://macgub.vxm.pl/win/win3ds03.zip -> application
http://macgub.vxm.pl/menuet/3ds_view/3ds_objects.tgz -> sample 3d objects Cool


Last edited by macgub on 13 May 2018, 09:05; edited 1 time in total
Post 22 Oct 2013, 10:09
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 353
macgub
Good work ! I know how not easy to write such code.
Be stubborn and believe in yourself !
You can write an article on how load 3ds model.
Post 31 Oct 2013, 08:56
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Roman
3ds files support added Madis Kalme in former times. This code take only a few lines. You can analize the win3ds.asm file. Not whole. Only, as I wrote, a few lines. (about 30-40). ...and thanks for your opinion about app.. Cool
Post 05 Nov 2013, 07:29
View user's profile Send private message Visit poster's website Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 617
It's stuff like this that makes me wish I had a CPU with AVX... Crying or Very sad Looks amazing though Cool
Post 05 Nov 2013, 18:00
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
@ Roman
Oops, my mistake the code witch load 3ds file contains about 100 lines.
Code:
read_from_file: fninit mov edi,triangles ; triangles -> contains lsit of polygons xor ebx,ebx ; each poligon 3 word integer -index ; to points_r xor ebp,ebp mov [points_count_var],0 mov [triangles_count_var],0 mov esi,[File_ptr] cmp [esi],word 4D4Dh jne .exit ;Must be legal .3DS file mov eax,dword[esi+2] ; cmp eax,[fsize] ; jne .exit add eax,esi mov [EndFile],eax ; add esi,6 @@: cmp [esi],word 3D3Dh je @f add esi,[esi+2] jmp @b @@: add esi,6 .find4k: cmp [esi],word 4000h je @f add esi,[esi+2] cmp esi,[EndFile] jc .find4k jmp .exit @@: add esi,6 @@: cmp [esi],byte 0 je @f inc esi jmp @b @@: inc esi @@: cmp [esi],word 4100h je @f add esi,[esi+2] jmp @b @@: add esi,6 @@: cmp [esi],word 4110h je @f add esi,[esi+2] jmp @b @@: movzx ecx,word[esi+6] add [points_count_var],cx mov edx,ecx add esi,8 @@: push edi mov edi,points_r ; each point 3 dwords float -> x, y, z push dword[esi+4] pop dword[edi+ebx*2+0] push dword[esi+8] pop dword[edi+ebx*2+4] push dword[esi+0] pop dword[edi+ebx*2+8] pop edi add ebx,6 add esi,12 dec ecx jnz @b @@: push edi mov edi,points_r mov dword[edi+ebx*2],-1 ; end mark (not always in use) pop edi @@: cmp [esi],word 4120h je @f add esi,[esi+2] jmp @b @@: movzx ecx,word[esi+6] add [triangles_count_var],cx add esi,8 @@: movsd movsw add word[edi-6],bp add word[edi-4],bp add word[edi-2],bp add esi,2 dec ecx jnz @b add ebp,edx jmp .find4k mov eax,-1 ;<---mark if OK .exit: mov dword[edi],-1 ret

@Cod
AVX version is not so fast like you expected, its rather slowly than sse2 version. It was only first try Smile
Post 07 Nov 2013, 07:30
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 353
how about texture? When support textures ?
Best way to direct you work to ray tracing and global illumination.
Because video cards very fast display 3d models and textures.
But raytracing helpfull on CPU witch AVX or SSE4
Post 07 Nov 2013, 18:43
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
All textured are generated. I don't load texture from file.
Post 08 Nov 2013, 07:22
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Win3ds04 can produce images like this:
Image
I implemented bumps map texture dependent, fixed bug badly textured lines, plain lines without z coordinate interpolation (code posted some time ago by PabloReda) etc...


http://macgub.vxm.pl/win/win3ds04.zip


Last edited by macgub on 27 Feb 2018, 19:33; edited 1 time in total
Post 17 Jan 2014, 13:16
View user's profile Send private message Visit poster's website Reply with quote
catafest



Joined: 05 Aug 2010
Posts: 100
@macgub
try to use shaders ...
also cuda implementation will be great ... also clean your code ... (sorry about this ...)
Post 20 Feb 2014, 10:58
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Excellent graphics and detail. Smile
Post 21 Feb 2014, 03:59
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
Thanks for your replies. Unfortunatelly my hardware don't suport CUDA. Also using shaders is for me rather difficult, any example ?
Post 24 Feb 2014, 07:14
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
I added editor wich produce solid object using rotared bezier curve. Result is displayed on fly. Editor mode avialable after pressing F2 key several times.
http://macgub.vxm.pl/win/win3ds05.zip


Last edited by macgub on 27 Feb 2018, 19:33; edited 1 time in total
Post 15 Sep 2014, 06:49
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 205
Location: Poland
I added *.asc models support, read and write. To write current object to object.asc file press F8.
http://www.macgub.vxm.pl/win/win3ds06.zip - binaries and sources.
http://www.macgub.vxm.pl/win/asc_objects.zip - example asc objects


Last edited by macgub on 27 Feb 2018, 19:33; edited 1 time in total
Post 15 Feb 2015, 15:59
View user's profile Send private message Visit poster's website Reply with quote
Mikl___



Joined: 30 Dec 2014
Posts: 78
Hi, macgub !
binary and source


Description:
Filesize: 64.56 KB
Viewed: 4802 Time(s)

1.png


Description:
Download
Filename: ftut_43.zip
Filesize: 3.43 KB
Downloaded: 233 Time(s)

Post 20 Feb 2015, 02:49
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:  
Goto page 1, 2, 3  Next

< 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 can download files in this forum


Copyright © 2004-2018, Tomasz Grysztar.

Powered by rwasa.