Monday, June 12, 2017

MKI SEARCHING GAME with MKI3D stages

MKI SEARCHING GAME has been updated in so that it uses directly the stages  designed with MKI3D. (All that is needed is to design the stage, place it in proper sub-directory and update the file with the index of the stages).

If you want to design your own stages, then clone the GitHub repository of the game with a git  command:
git clone https://github.com/mki1967/mkisg-chrome.git
and follow the instructions in README.md.

Here is a recent screen-cast on YouTube with some stages:



UPDATE: The game version at:


has touch events implemented and can be played in a browser on mobile device.

Saturday, May 13, 2017

Testing distribution on SourceForge and Bintray (Linux)

Update:
I have placed on SourceForge Download mki3dgame  the compiled binary  executable for linux-amd64 of mki3dgame version 1.0 (now updated to version 1.1, with a version for windows_amd64 added)

Now I have placed my first AppImage of the Linux version of the game.
AppImage bundles the executable program with its data (game assets).
You can find more informations about AppImage on the following pages:


All you have to do is to download the file, change its mode to executable:

$ chmod a+x mki3dgame-x86_64.AppImage

and just run it:

$ ./mki3dgame-x86_64.AppImage 

(If you do not care for text messages printed in the terminal, then you can also start the application by clicking on the executable file in a file manager.)

Download mki3dgame



Also available on Bintray  :
  

Tuesday, May 9, 2017

Tip: You Can Use Text-Areas and Text Repositories

With the use of text areas, you can distribute your simple designs directly from the browser to browsers (even without using files on local machine). You can use public text repositories. Here is some data copy-pasted to a Gist with a comment how to load it:

 If successful, you should see something like that:

As another example, you may use the same copy-pasting of raw text files to view the shapes from mki3dgame assets in the following GitHub directories:

Thursday, May 4, 2017

Packages for Go programming language and a Game in Go

I have prepared Go packages in the repository https://github.com/mki1967/go-mki3d that can be used to load  the data produced by MKI3D and display with go-gl tools for OpenGL with Golang.

 As a working example you can find a simple game mki3dgame in https://github.com/mki1967/test-go-mki3d .
To run the game you need to have installed  Go language and the packages:

  • "github.com/go-gl/gl/v3.3-core/gl"
  • "github.com/go-gl/glfw/v3.2/glfw"
  • "github.com/go-gl/mathgl/mgl32"
  • "github.com/mki1967/go-mki3d/mki3d"
  • "github.com/mki1967/go-mki3d/glmki3d"

In the game you have to collect tokens randomly scattered in the stages while avoiding the monsters (they can capture you).
You can design your own stages, monsters, and tokens in MKI3D and place them in respective sub-directories of the assets directory.
 Here is a short screen-cast on YouTube:
https://youtu.be/vp6nhvOqhdU

Monday, March 20, 2017

Tutorial Post 13: Cursor Jumping.

Tutorial Post 13: Cursor Jumping.

While you are moving the cursor with arrow keys and 'B','V','F' keys, the set of reachable positions is limited to the three-dimensional grid of points in the model space separated by cursor step distance in each dimension. You can change the cursor step on the Inputs Page ('QI...'): 


(Note that changing the cursor step also updates the view scale, so that the cursor's size and step remain the same to the observer's view.)
In some cases you may want to move a cursor to some hardly reachable position. For example, you have inserted   a regular polygon (as in Tutorial Post 12) and you want to move the cursor one of its vertices. You may move the the cursor close to the desired vertex (endpoint) and then use the option: 'JUMP TO THE NEAREST ENDPOINT' on the Cursor Menu ('QCJ').



Then the cursor should be moved to the nearest endpoint:


(Note that you have also the option: 'JUMP TO THE NEAREST SELECTED ENDPOINT', which could be useful if you can select between closely placed sets of endpoints.)

Other options for  'CURSOR JUMPING' are available as a sub-menu of  Constructive Methods ('QMJ...').


You can move the cursor to the center of visible constructive points. You can use this option together with the command that sets the constructive points 'U' and 'W' on the bounding box of the selected endpoints ('QMB') available on the Constructive Methods Menu:



 When 'U' and 'W' are the only visible constructive points, the key sequence 'QMJ0' moves the cursor to the center of the bounding box of the selected endpoints.



You may also move the cursor to the centroid (arithmetic mean) of the selected endpoints 'QMJC'. However, be aware that there could be many endpoints in some position, where you see only one selection mark.
There is also option to move the cursor to the intersection of the line 'AB' and the plane 'CDE', where 'ABCDE' are visible constructive endpoints (key sequence 'QMJ1'). See how the yellow cursor has been placed on the figure below:




Saturday, March 18, 2017

Tutorial Post 12: Regular Polygons.

Tutorial Post 12: Regular Polygons.

You may create regular polygons. The option is available on the Constructive Inserting Menu ('QMI...').  Either press the key sequence 'QMI3'  to insert the outline of the polygon made of segments, or press 'QMI4'  to insert the triangles that are sectors of the polygon surface. 


The polygon is placed on one of the planes OXY, OXZ, OYZ, that is most parallel to the screen, and it is centered at the cursor. The endopoints of the polygons' elements are indexed with a new (unused set index). Thus you can select them wit 'QSS' for further manipulations.
The number of polygon's vertices is a parameter that can be set on the Inputs Page ('QI...'):


Thursday, March 9, 2017

Tutorial Post 11: Three-point Transformation.

Tutorial Post 11: Three-point Transformation.

Three-point transformation 'ABC' -> 'DEF' transforms selected endpoints by isometric transformation that transforms the point 'A'  to the point 'D', the half-line 'AB' to the half-line 'DE' and the plane 'ABC' to the plane 'DEF'.  Three-point transformation is available on the constructive methods sub-menu ('QM...').


Before you can apply the transformation you need to set six constructive points ('QPS...' - see Tutorial Post 5) and select the endpoints to be transformed ('QS...' - see Tutorial Post 4):





Then you can execute the transformation (i.e. by the key sequence 'QMT'):




Note that the selected point from point 'A' has been transformed to the point 'D' and the selected segment from 'AB' has been transformed on the line 'DE'.
On the following view from another perspective you can see that the selected points from the plane 'ABC' are transformed on the plane 'DEF'. 





Thursday, February 23, 2017

Display mode.

Display mode.

In the standard (editing) mode you are forced to see the cursor and the upper message on the displayed view:

  Now you can remove the cursor and the upper message from the canvas by pressing the 'D' key:

This is useful if you want to save the current view into image file. You can take a screen-shot or - if you run mki3d in the web-browser - you can save graphics on the right-mouse-button pop-up menu. 
(I have implemented this feature, because I wanted to make some stereoscopic views that don't look like the cursor's selfie ;-)



Pressing any key resumes standard display mode for further editing.


Tuesday, February 7, 2017

Red-blue stereoscopic mode.

Red-blue stereoscopic mode.



Stereoscopic mode visible with red-blue glasses has been added to mki3d. You can toggle stereo/mono mode by pressing the sequence of keys: 'QVS'  (i.e. the 'S' option on the 'View' submenu).
Parameters of the stereoscopic display, such as intensities of the red and blue components and "eye shift"  (half of the  distance between the eyes) can be fine-tuned on the Inputs Page ('QI').

Here you can find some stereo more screen-shots.


Monday, January 23, 2017

Tutorial Post 10: Inputs Page.

Tutorial Post 10: Inputs Page.

You can invoke Inputs Page by pressing the sequence of two keys: 'Q' 'I'




Inputs Page is used for typing in some parameters in text input fields.
Type in the values of the parameters in respective text fields and press ENTER. You may also press ESC or 'Q' to leave the Inputs Page without changing the parameters.

Sunday, January 22, 2017

Tutorial Post 9: Action Modes.

Tutorial Post 9: Action Modes.

Action mode specifies the actions of  'B', 'V', 'F' and arrows  keys. The default action mode is rotation:
 In this mode, pressing one of 'B', 'V', 'F' and arrows  keys rotates  the model  in selected direction around its focus point, which is, usually, the current cursor position. 
To move the cursor you heave to select cursor mode:
This mode is selected when the Shift key is pressed down. When you release the Shift key, the rotation mode is restored. While you are cursor in the cursor mode, the current position of the cursor is being displayed:
 (The simplest way to see the current cursor position is to press the Shift key. Note that after releasing the Shift you will have rotation mode.)

There are also action modes for moving, 90-degrees rotations, and mirroring of the selected endpoints. You can set these modes on the action modes menu which is invoked by pressing the 'A' key:
If you accidentally enter such "selected endpoints mode" while there are no selected endpoints, you may have impression that the application is not responding: 
 Just press and release Shift key to escape back to rotation mode.

Saturday, January 7, 2017

Tutorial Post 8: Light.

Tutorial Post 8: Light.


The final color of the pixel on the screen is its RGB color vector multiplied by its brightness which is a factor with a value between zero and one. Edges are displayed in their full brightness (i.e. brightness=1.0). The brightness of the triangle is a sum of two components: 
  • a fixed ambient component (default initial value is 0.2)
  • a directional component
The value of the directional component depends on the angle between the direction of the directional light and the plane of the triangle. The more perpendicular the triangle is to the direction of of the light, the greater is the value of directional component of its brightness. 

Initially the directional light is parallel to the Z axis af the model space:


When the model is rotated, you can see the sides that are parallel to the direction of the light (they have only ambient component of the brightness):


You can set the direction of the light to the direction you are looking at, by pressing the sequence of the keys 'QDL' (i.e. 'L' key on data sub-menu):


Thursday, January 5, 2017

Tutorial Post 7: Colors.

Tutorial Post 7: Colors.

You can invoke color-chooser sub-menu to select the color of the cursor ('QCC') or of the background  ('QDB'):

You can choose one of the eight predefined colors by pressing one of the keys: '0', ... , '7'.
You can also 'fine tune' each component of the color  by pressing one of its two keys. For example, the red component is increased by pressing 'R' and it is decreased by pressing 'E' (next key left to 'R' on QWERTY keyboard).
If you want to reuse  some color that is already used in the model you can select some endpoint with this color and use the 'N' key. The 'N' key cyclically selects colors from the selected endpoints. (Sometimes it is hard to select a single endpoint if other endpoints are in the same place.)
Note that the color-chooser sub-menu is persistent. To leave it, you have to press one of the keys: 'Q', ESCAPE, ENTER.    

Wednesday, January 4, 2017

Tutorial Post 6: Clipping.

Tutorial Post 6: Clipping.


Sometimes the fragment you want to edit is obscured by some other objects. You may use use clipping to prevent drawing the fragments that are outside  specified clipping box. 

Go to the clipping sub-menu with the sequence of key presses 'QX':


In the following example you see blue cube without any clipping:

Note the position and orientation of the cursor. When you invoke clipping sub-menu ('QX') and press the left arrow on it, then you move the 'maximum'  X coordinate of the clipping box to the X coordinate of the cursor. Clipping box is aligned with the model space. The direction of clipping is determined the same way as the direction of moving the cursor. 
Now you can see the smaller red cube hidden inside the blue one as the fragment of the blue box outside of the clipping box is not drawn.  (If you clicked 'QX' left arrow again, then the  X coordinate of the clipping box would be reset to its initial, very large, value. Arrows and 'B', 'F' keys on clipping sub-menu act as toggle switches.)

Let us press 'QX' and down arrow:
The maximum Y coordinate of the clipping box has been set to the Y coordinate of the cursor.

To cancel  clipping press 'QX' and then 'R'. (Actually, it resets the clipping box to its initial, very large  volume.)