23 February 2021, 22:52 | #1 |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
[ASM68000] rubik's
Hi,
30 years after, i worked for monthes to code a 3D rubik's cube... with rotations of faces. Here is the picture of the result : Please find the code there (Sorry all my comments are in french). https://github.com/Amiga68000/Rubiks...tag/2021-02-08 Don't hesitate to give me feedback if you find bug, optimizations or have suggestions or ideas. Any question, please ask. If i find motivation, i will try to implement filled shapes. Thanks & have fun Arnaud |
24 February 2021, 00:41 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Did one of those back in 92-93 with filled vectors and white line vectors for the grid.
I used 2x3 dual playfield so I only had to deal with 2 easy peasy convex objects, each in its own playfield, rotated two sets of 8 corner points and the rest was generated with unit vectors. |
24 February 2021, 07:32 | #3 |
Registered User
Join Date: Feb 2009
Location: Amiga
Posts: 465
|
Very cool! You should make it into a full demo that we can play around with or randomize the rotations then try to solve it automatically!
|
24 February 2021, 09:54 | #4 | |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
warning : somes bsr (pc) and bra (pc). work with jsr not bsr. doesn't work with asmone
Quote:
is it this one ? |
|
24 February 2021, 10:17 | #5 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Yep, the latter.
|
24 February 2021, 10:27 | #6 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
Made In Croatia / Binary (1993) :
http://janeway.exotica.org.uk/release.php?id=9158 impressive rubik's cube can you tell more about how that work ? (differences with the one by Arnaud) thanks |
24 February 2021, 23:09 | #7 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Eh, it's simple stuff made for a demo, nothing more nothing less. Didn't check Arnaud's code in detail, french gives me exception #4 ;p, but it looks like a completely different approach.
As I said, dual playfield is the critical part, makes rendering trivial. Simple "script", takes a series of +/- 1-6 (6 possible moves, sign determines rotation direction), selects one of 6 predefined poly/corner sets, generates inner 3d points, does some math and throws everything at the screen, Tops everything off with shiny line vectors to hide ugly edges ;P. The usual convex vector demo stuff. Playfield priority (and the consequent remapping of colors) is based on the sum of corner z coords. |
25 February 2021, 22:23 | #8 | ||
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
Why not Valken, but including a solver will be a little bit harder for me
First a simple demo should be easier. Quote:
Quote:
@a/b, not sure to understand in details the method you describe : If you do (or not) a rotation of a layer you use 2 playfields for 2 3D-objects, 1 for the body(without the layer) + 1 for the layer in rotation You calculate only 8 corners per 3D-object, using a linear interpollaton, you calculate shapes and fill them. i'm right ? Why 2 playfiels, is it to simplify the filling ? What i did is more complicated (i calculated and display each visible shape) and must use more CPU than your method "Merci pour l'astuce" ;p I will try to think how to implement it |
||
25 February 2021, 22:55 | #9 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
I just compiled your source with asm2 and winuae 4400 : nothing on the screen, except text and debug : no cube
I see the cube with debugdisplayraster=1 |
25 February 2021, 23:05 | #10 | |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
I don't understand,
I just download and tried the source and it works with my config : - WinUAE 64.4.4.0 (A500 / 1Mo / true time) - ASMTwo What is your config under WinUae ? A500 or more ? Quote:
|
|
25 February 2021, 23:09 | #11 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
1 bsr and 1 bra to clean, it's enough
but on winuae32 4.4.0 (A500) : no cube on the screen only with debugdisplay_raster=1 with ASMTwo ! and no more with asmone Last edited by heavy; 25 February 2021 at 23:18. |
25 February 2021, 23:15 | #12 |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
You remind me a bug.
line 1680 : Code:
dc.w COLOR01,MIRROR_SCROLL_COLOR dc.w COLOR02,MIRROR_SCROLL_COLOR dc.w COLOR03,MIRROR_SCROLL_COLOR ;dc.w COLOR04,MIRROR_SCROLL_COLOR dc.w COLOR05,MIRROR_SCROLL_COLOR dc.w COLOR06,MIRROR_SCROLL_COLOR dc.w COLOR07,MIRROR_SCROLL_COLOR On my machine if I uncomment COLOR04, the cube is not displayed Maybe you need uncomment more than 1 line. I didn't find time to investigate this bug .. if someone has an idea ... |
25 February 2021, 23:23 | #13 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
nop, and now I have a guru
problem with the copperlist |
25 February 2021, 23:28 | #14 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
line 1499
change Code:
move.l #COPSIZE-1,d0 ; problem with COPSIZE/4. works also with COPSIZE/2 .w move.l #CopListDataStart,a0 move.l copperlist_PTR,a1 .l2: move.b (a0)+,(a1)+ ; .b or .w if copsize/2 <- .L dbf d0,.l2 you don't need to allocmem in chip and copy the coplist Last edited by heavy; 25 February 2021 at 23:44. |
25 February 2021, 23:36 | #15 | |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
which machine do you emulate ?
Bellow extract of my config .uae Quote:
|
|
25 February 2021, 23:38 | #16 |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
OK for the CODE_C, thanks
|
25 February 2021, 23:43 | #17 | |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
Quote:
|
|
25 February 2021, 23:49 | #18 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
there is an issue with your copperlist
if I put a comment somewhere, screen stay black |
26 February 2021, 00:17 | #19 | |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Quote:
Yes, 1 blit to clear, draw all the edges in fill mode, and finally 1 blit to fill. Also, calculate min/max x/y so you don't have to clear/fill the entire buffer. |
|
26 February 2021, 12:42 | #20 |
Registered User
Join Date: Nov 2020
Location: France
Posts: 18
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|