News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

A Cube3D

Started by HSE, August 02, 2017, 10:58:11 PM

Previous topic - Next topic

HSE

Hi all!

Just expecting AVCaballero's codes ( :biggrin: ), I found some very interesting masm32 simple cube  codes from Tom-Art tutorials 1 and 2.

With very little modificactions I increase the options. The minimum binary have 7k but here I added resources preventing someone could have AV problems.     

  --------------------------------
      Updated 3 August 2017
   ---------------------------------
Equations in Assembly: SmplMath

avcaballero


jj2007

Quote from: HSE on August 02, 2017, 10:58:11 PMTom-Art tutorials 1

Très jolis, ces cubes :t

Mais les tutoriels sont tous en français. Qu'est-ce qu'il se passe? Meme Erol écrit en français maintenant ::)

HSE

Quote from: jj2007 on August 03, 2017, 12:13:55 AM
Mais les tutoriels sont tous en français. Qu'est-ce qu'il se passe? Meme Erol écrit en français maintenant ::)

Je ne se pá. Je ne comprend pá. Fortunatelly the code is masm32.

Yesterday I saw "Crocodile Dundee 3 (2001)"... and everybody speak Italian!! Even when escaping from Hutch friends (australian crocodiles)  :shock:
Equations in Assembly: SmplMath

jj2007

Quote from: HSE on August 03, 2017, 12:33:38 AMYesterday I saw "Crocodile Dundee 3 (2001)"... and everybody speak Italian!!

Are you sure it wasn't Austritalian?

Siekmanski

Nice, but the Z-Axis needs to be inverted to get perspective 3D rotation.
The back side of the cube is now larger as the front side, this should be the other way around.
Creative coders use backward thinking techniques as a strategy.

HSE

Quote from: jj2007 on August 03, 2017, 12:35:46 AM
Are you sure it wasn't Austritalian?
Apparently was an italian production. The titles of the movie are italian, and the italian voices fit so well that perhaps actors say the lines in italian. 

Quote from: Siekmanski on August 03, 2017, 12:36:25 AM
Nice, but the Z-Axis needs to be inverted to get perspective 3D rotation.
The back side of the cube is now larger as the front side, this should be the other way around.
Something don`t look very well. I will see. But scene is not really an scene, just a replication of the same cube that is easy with OOP.
Equations in Assembly: SmplMath

avcaballero

You have first to define your axis. Everyone is a world  :icon_rolleyes:

Usually:

         ^ y+
         |
         |
         |  / z+
         | /
  ---------------> x+
        /|
       / |

If you are in your position, z increases inside your monitor and it is usually what you want to paint.

But there are other people that considers

         ^ y+
         |
         |
         |  / z-
         | /
  ---------------> x+
        /|
       / |

That means that z increases pointing to you that maybe is what you'd like to paint.

But other people exchanges y and z axis, I think that is common in the USA.

When you paint the solid cube, there are many ways to do it in such a way that the faces that are in the backwards are not painted, just those that are closer to you, only those that your eyes can reach.

I haven't seen your code, but maybe this can help. :t

TWell

But that is Z buffer and tree finger rule, look your thumb where it points. :icon14:
Z is positive from object to watcher.

HSE

Quote from: TWell on August 03, 2017, 03:43:13 AM
Z is positive from object to watcher.
I think in that way, apparently also Tom-Art.  :t
Equations in Assembly: SmplMath

Siekmanski

3-D Coordinate Systems

Typically 3-D graphics applications use two types of Cartesian coordinate systems: left-handed and right-handed. In both coordinate systems, the positive x-axis points to the right, and the positive y-axis points up. You can remember which direction the positive z-axis points by pointing the fingers of either your left or right hand in the positive x-direction and curling them into the positive y-direction. The direction your thumb points, either toward or away from you, is the direction that the positive z-axis points for that coordinate system. The following illustration shows these two coordinate systems.



If you use a left-handed coordinate system and you are porting an application that is based on a right-handed coordinate system, you must make two changes to the data.

Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them as v0, v2, v1.

Although left-handed and right-handed coordinates are the most common systems, there is a variety of other coordinate systems used in 3-D software. For example, it is not unusual for 3-D modeling applications to use a coordinate system in which the y-axis points toward or away from the viewer, and the z-axis points up. In this case, right-handedness is defined as any positive axis (x, y, or z) pointing toward the viewer. Left-handedness is defined as any positive axis (x, y, or z) pointing away from the viewer. If you are porting a left-handed modeling application where the z-axis points up, you must do a rotation on all the vertex data in addition to the previous steps.

Here an example that shows that the backside of the cube is smaller than the front, it uses a left-handed coordinate system.
Creative coders use backward thinking techniques as a strategy.

HSE

Equations in Assembly: SmplMath

HSE

Corrected perspective (Tom-Art forgot it totally) in first post.

Now, after reversion, is failing face selection  :biggrin:
Equations in Assembly: SmplMath