flat assembler
Message board for the users of flat assembler.

Index > Windows > win3ds

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



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 25 Jan 2013, 12:59
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.co.pl/win/win3ds00.zip
Image


Last edited by macgub on 16 Jan 2022, 16:13; edited 4 times 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: 346
Location: Poland
macgub 20 Feb 2013, 10:10
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.co.pl/win/win3ds01.zip


Last edited by macgub on 16 Jan 2022, 16:13; edited 3 times 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: 1150
Location: Russian Federation
comrade 22 Feb 2013, 10:15
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: 155
Location: Poland
randall 22 Feb 2013, 14:48
Great work!
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: 346
Location: Poland
macgub 25 Feb 2013, 07:35
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: 346
Location: Poland
macgub 11 Mar 2013, 11:38
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.co.pl/win/win3ds02.zip
a few 3ds objects:
http://macgub.co.pl/menuet/3ds_view/3ds_objects.tgz


Last edited by macgub on 16 Jan 2022, 16:14; edited 3 times 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: 346
Location: Poland
macgub 22 Oct 2013, 10:09
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.co.pl/win/win3ds03.zip -> application
http://macgub.co.pl/menuet/3ds_view/3ds_objects.tgz -> sample 3d objects Cool


Last edited by macgub on 16 Jan 2022, 16:14; edited 3 times 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: 1777
Roman 31 Oct 2013, 08:56
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: 346
Location: Poland
macgub 05 Nov 2013, 07:29
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: 618
cod3b453 05 Nov 2013, 18:00
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: 346
Location: Poland
macgub 07 Nov 2013, 07:30
@ 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: 1777
Roman 07 Nov 2013, 18:43
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: 346
Location: Poland
macgub 08 Nov 2013, 07:22
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: 346
Location: Poland
macgub 17 Jan 2014, 13:16
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.co.pl/win/win3ds04.zip


Last edited by macgub on 16 Jan 2022, 16:14; edited 5 times 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: 129
catafest 20 Feb 2014, 10:58
@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
Fixit 21 Feb 2014, 03:59
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: 346
Location: Poland
macgub 24 Feb 2014, 07:14
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: 346
Location: Poland
macgub 15 Sep 2014, 06:49
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.co.pl/win/win3ds05.zip


Last edited by macgub on 16 Jan 2022, 16:15; edited 3 times 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: 346
Location: Poland
macgub 15 Feb 2015, 15:59
I added *.asc models support, read and write. To write current object to object.asc file press F8.
http://www.macgub.co.pl/win/win3ds06.zip - binaries and sources.
http://www.macgub.co.pl/win/asc_objects.zip - example asc objects


Last edited by macgub on 16 Jan 2022, 16:15; edited 3 times 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: 129
Location: Russian Federation, Irkutsk
Mikl___ 20 Feb 2015, 02:49
Hi, macgub !
binary and source


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

1.png


Description:
Download
Filename: ftut_43.zip
Filesize: 3.43 KB
Downloaded: 1382 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, 4, 5, 6  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 © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.