flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4, 5 Next |
Author |
|
macgub
Hi Mikl.
You uploaded OpenGL example. I make app non ogl. It is more operating system and any library independent. Thanks anyway. ![]() |
|||
![]() |
|
macgub
win3ds07. I added multi Bezier curves editing option (goes to rotary solid object) and new editing possibility - Bezier pipes (after pressing F2 several Times). I added also saving to 3ds file option. More info in readme.txt file in package:
http://macgub.co.pl/win/win3ds07.zip Enjoy ! Last edited by macgub on 16 Jan 2022, 16:16; edited 3 times in total |
|||
![]() |
|
macgub
I don't know. I compile with FASM 1.69.50 and all is OK. So...
![]() |
|||
![]() |
|
macgub
OK. I uploaded fixed version win3ds07. Link as above. Compiles correctly in FASM 1.71.39
|
|||
![]() |
|
ly47
macgub wrote: OK. I uploaded fixed version win3ds07. Link as above. Compiles correctly in FASM 1.71.39 Hi Thanks I have fixed it myself by changing lines like: mov [Bz1_axis],0.0 to: mov dword[Bz1_axis],0.0 Thanks again ly |
|||
![]() |
|
macgub
win3ds08. Main change is: every segment of rotated Bezier solid can be rotated independent. Choosing active Bezier segment by pressing F9 - cyclic switching. More info, please read readme.txt file.
http://macgub.co.pl/win/win3ds08.zip Last edited by macgub on 16 Jan 2022, 16:16; edited 3 times in total |
|||
![]() |
|
macgub
win3ds09. Bezier pipes editing option. Each segment can be rotated indywidually. Also posibility to edit pipes and Bezier curves based rotated solids parerell.
http://macgub.co.pl/win/win3ds09.7z
Last edited by macgub on 16 Jan 2022, 16:16; edited 3 times in total |
||||||||||
![]() |
|
macgub
Hi, I want proudly present:
win3ds10. ![]() I implemented displacement mapping texture dependent. This option requires correctly declared vertexes (non mismatched senses of normal vectors). This effect looks good on objects described with many triangles - (I added dividing face into smaller faces option). Also posibility to load texture (512X512 24bit 0xRRGGBB raw uncompressed format), and simple texture moving directly on object, was added. http://macgub.co.pl/win/win3ds10.7z Last edited by macgub on 16 Jan 2022, 16:17; edited 3 times in total |
|||
![]() |
|
randall
Very nice! Good work.
|
|||
![]() |
|
macgub
There is such problem: when one triangle is divided to four triangles, and this is repeated a few times, arises many triangles that are on the same flat surface. So such flat area don't looks nice when only direction lights are using; (for now only such lights I implemented). Such situation need points lights.
|
|||
![]() |
|
macgub
Win3ds11
I added some GUI buttons to make work with app more comfortable. http://macgub.co.pl/win/win3ds11.7z Last edited by macgub on 16 Jan 2022, 16:17; edited 3 times in total |
|||
![]() |
|
idle
Hi, can you tell in short about:
- 3d-2d coords mapping - primitives (dots, triangles?) for model representation - simple-most shading THANX |
|||
![]() |
|
macgub
Hi, best answer for topics you ask, is tranlate my tutorial ( http://macgub.co.pl/%21shading) into english. but I try short answer for for this subjects:
ad3 Simplest shading is flat shading. We drawing triangle filled only one color. To draw such triangle we interpolate x coordinates along y coordinate. (the begin and end of horizontal line) then we draw single line by ex. rep stosd (in 32 bit mode). Whole triangle is filled by such horizontal lines. When we want use Zbuffer we should interpolate z coord also. ad2 Drawing dots is simply drawing all vertices ( scaled and translated into app window). ad1 To draw 3d object in 2d screen we use perspective equations or we use axis z gradient (obliquity), or (so I done in my app ) just skip z coordinate (parallel projection). Sorry for to short answer, poor english. Thanks anyway for your reply. Im going to translate my tut soon. Good luck! Last edited by macgub on 16 Jan 2022, 16:18; edited 3 times in total |
|||
![]() |
|
macgub
Hi!
You may also take a look at (for example): http://www.futuretech.blinkenlights.nl/graphics.html I think, internet is full of well done tutorials. I search a bit and i'm suprised positively. So if so many papers describes those problems, there is no so large need to translate my tutorial. So I 'm not convicent I do it soon (or ever). Sorry... |
|||
![]() |
|
macgub
I traslated algorithm of drawing flat shaded single triangle from my tut:
Code: Flat shading algorithm: NOTE: Algorithm uses only integer variables. 1. Sort triangle vertices towards Y coordinates (from lowest to greatest). 2. Calculate increments between triangle vertices using equations: a) dx12=(x2-x1)/(y2-y1) b)dx13=(x3-x1)/(y3-y1) c)dx23=(x3-x2)/(y3-y2) when you calculate increments, numerator multiply by 256, if denominator is equal 0, then make increment dx = 0. 3. x11=x1; x12=x1, it means xk1=256x1; xk2=256x1 4. y=y1 5. x11=xk1/256; x12=xk2/256 6. Check, if not x11 =< x12 than exchange points order (x11,y) and (x12,y). 7. Draw horizontal line from point (x11,y) to point (x12,y). 8. x11=x11 + dx13, it means xk1=xk1 + dx13 9. x12=x12 + dx12, it means xk2=xk2 + dx12 10. y=y+1 11. If y < y2 than repeat from 5 step. 12. x11=x11 (none change); x12=x2, it means xk1 without change so like after loop end; xk3 = 256 * x2 13. y = y2 14. x11 = xk1/256; x12 = xk3/256; 15. Check, if not x11 =< x12 than exchange points order (x11,y) and (x12,y). 16. Draw horizontal line from point (x11,y) to point (x12,y). 17. x11 = x11+dx13; it means xk1 = xk1 + dx13. 18. x12 = x12 + dx23; it means xk3 = xk3 + dx23. 19.If y < y3 than repeat from 14 step. NOTE: Steps 4-11 and 13-20 should be implemented as loops. Multiplication and division by 256 should be implemented as bit shifts. |
|||
![]() |
|
pabloreda
mac
if you draw a triangle, not need check if x-ini and x-end swap, step 6 and step 15 can be done outside the loop |
|||
![]() |
|
idle
These days it seems a magic to me.
Anyway thank you for the push/direction. According OGL: just using it does not suffice - internals with formulas and principles do. That's why we are here ![]() |
|||
![]() |
|
macgub
Thanks for replies.
Pablo You are right, nice improvement. It will spare some clockcycles. Maybye I defeat my laziness and implement it in my drawing_triangle procs. ![]() |
|||
![]() |
|
randall
idle wrote: These days it seems a magic to me. OGL internals just translates API function calls to GPU native commands and pushes sets of those commands (called command buffers) to the HW. There is no magic. Just huge pile of often ugly code. |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4, 5 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.