Jump to content
  • Advertisement

8Observer8

Member
  • Content Count

    298
  • Joined

  • Last visited

  • Days Won

    9

8Observer8 last won the day on July 21

8Observer8 had the most liked content!

Community Reputation

297 Neutral

3 Followers

About 8Observer8

  • Rank
    Member

Personal Information

  • Role
    3D Artist
    Programmer
  • Interests
    Art
    Programming
    QA

Social

  • Github
    8Observer8

Recent Profile Visitors

10673 profile views
  1. Textured Rectangle in pure WebGL 1.0 and TypeScript. I use glMatrix for Linear Algebra. Playground: Plunker: https://next.plnkr.co/edit/4pnm93F1eWQuvpYg?preview CodeSandbox: https://codesandbox.io/s/textured-rectangle-with-transforms-typescript-s7gfb
  2. 8Observer8

    CS Student Looking for Industry Advice

    It is not an advertisement, I am really like these text tutorials: http://noobtuts.com/ You can find a lot of free tutorials in favorite programming language. I think that C# and Python are good languages for start. If you choose C# you can easy to switch to Unity. Read this article: https://noobtuts.com/articles/make-small-games Make small Games Foreword Time to create the first game. Let's make a big MMORPG right? The Problem Game developers are enthusiasts. Game developers have big ideas in their head. Now what usually happens is that for their first game they decide to jump right into their dream project. Time goes by, code gets written and after half a year the project fails due to the overwhelming project size. People get disappointed, teams split up, toes are being stepped on. After taking a little break, they realize that they still love game development and jump right into the next project. This time it's no MMORPG, just a Skyrim clone. The pattern repeats itself. After a few months people get overwhelmed again. But what is it? Is it the team? Is it the wrong game engine? Is it a lack of skill? Working on a game project for half a year takes a whole lot of time and hard work. Failing it and knowing that the time was pretty much wasted is the most painful experience that beginners make. And sadly, they make it over and over again. The Solution The solution is incredibly simple: make small games. When starting the first game project, the most important thing is to keep it small. From all the ideas you have, pick the smallest one. Maybe make something of the size of pong with a few more special effects, but make it as polished as a game can be. One month later, chances are high that you will have a finished game in your portfolio. It might be a small one, but it's fun, it's polished and finishing it will be a great ego boost for you. Who knows, maybe you can even make a few dollars with it. Now the next game project starts. The goal should be a game that is just slightly bigger than the previous one. If the first one took one month to make it, try to make a two months game now. Finish it, polish it, release it and learn from it. That's the process that leads to finishing your dream project some day! And on a side note: looking at a list of 20 games that you finished successfully is a great feeling. Summary Starting small and getting confidence and experience is the single most important thing to learn about making games. There is not a single successful MMORPG out there that was created by people who made their first game. Even smaller multiplayer games like Minecraft are usually not someones first project. To be exact, the creator was making games for 20 years already, this should give you an idea about how important experience really is.
  3. 8Observer8

    Make a game like Mario Wanted

    You can use: Unity, Godot, MonoGame, SFML.NET, and so on. Or you can even write you own 2D game engine using OpenGL from scratch, but it very complicated, it requires: Linear Algebra (matrices, vector), trigonometry, math for shaders (lighting, specularMap, normalMap and so on). I like Unity and I like to study how to write my simple 2D/3D game engines from scratch. If you want to study OpenGL, shaders, and math you can start with this video course: Creating Cross Platform Games with Xamarin This course uses OpenTK for binding with OpenGL. OpenTK is built-in in Xamarin. In addition if you like math you can use OpenGL for math plots, 3D diagrams and so on. I think you should start with Unity.
  4. I want to rewrite the examples to Phaser 3 and TypeScript. Maybe it will be useful for beginners who read the book. 2.3 - First Project: Playground
  5. This is an official link to original book examples in JavaScript: https://github.com/kittykatattack/learningPixi I rewrite the examples to TypeScript and Pixi.js v5. I will public examples on: Playground. You will be able to see a code and a result. I use complication to AMD modules (Asynchronous Module Definition) and the RequireJS library to load AMD modules GitHub Pages. I use compilation to CommonJS modules. I bundle JS files to bundle.min.js using Browserify and minify it to bundle.min.js using UglifyJS Source code on GitHub: will be later I will NOT use Webpack, Gulp, Grunt and so on. I will public the instruction on GitHub how to build examples locally in the README.md file. Note. Release version is loaded more quickly, but on playground you can see a code, you can make a fork, change the code and save it with a new link. Hello World: playground, release Displaying the canvas: playground, release Sprite From Image: playground
  6. 8Observer8

    Free HLSL Shader Tutorial Videos

    I think your lessons will be useful for OpenGL/WebGL programmer too. I see that HLSL and GLSL are similar. In any case they use math and math is equal. I will study how to use HLSL in Unity. I study Blender but I understand what you make in 3DsMax. Thank you very much for sharing!
  7. This video tutorial is very great! For example, we want to add a cube on a scene: bpy.ops.mesh.primitive_cube_add() You can read about this API function in the documentation: primitive_cube_add Create a work folder with the name: mock-object-for-primitive_cube_add-api Open Blender and safe project in the work folder Open "Scripting" tab in Blender from the top menu Open your favourite Python editor. I use VSCode. You can read about how to use VSCode with Python here Python in Visual Studio Code Create a file with the name "main.py" in you favourite Python editor. This file must be placed in the "mock-object-for-primitive_cube_add-api" folder Write in the "main.py": print("hello from blender") You can run this code from command line terminal or from VSCode internal terminal. Press in VSCode "Ctrl+`" and enter command: python main.py You will see in the console terminal this message: If you opened "Scripting" tab in Blender you will see an ability to open Python script in Blender. Click on the "Open" Button in Blender Script editor inside Blender Choose the "main.py" file and click the "Open Text Block" button Open the Blender console terminal. For this you need to select in the main menu of Blender "Window" and select "Toggle System Console" Run the "main.py" script from Blender. For this you need to place your mouse pointer on text area and press "Alt+P" button You will see this message in the Blender console terminal: If you will change a code in an external editor like VSCode you need to reload in the Blender text editor. For this you need to press the "Alt+R+R" button You need to add only one file: "main.py" to the Blender text editor. Another files you need place in the work directory: "mock-object-for-primitive_cube_add-api" Copy this code to the "main.py" file: main.py import bpy import sys import os # Get a path to the directory with .blend file # There are the scripts in this directory dir = os.path.dirname(bpy.data.filepath) # Is the directory in the list with included # directories? If no, include the directory if not dir in sys.path: sys.path.append(dir) import object3d_service # Reload module. It is necessary if you use # external editor like VSCode # For reloading module you need to press in # Blender: Alt + R + R import importlib importlib.reload(object3d_service) # Note. You do not need to open all scripts in Blender, # you need only this script from object3d_service import Object3DService def main(): objectService = Object3DService() objectService.create_cube() if __name__ == "__main__": main() This is another files that you need to copy to the work directory: test_blender_service.py import unittest from unittest.mock import MagicMock from object3d_service import Object3DService class BlenderServiceTest(unittest.TestCase): def test_myTest(self): # Arrange object3DService = Object3DService() object3DService.blender_api.create_cube = MagicMock("create_cube") # Act object3DService.create_cube() # Assert object3DService.blender_api.create_cube.assert_called_once() object3d_service.py from blender_api import BlenderAPI class Object3DService: def __init__(self): self.blender_api = BlenderAPI() def create_cube(self): self.blender_api.create_cube() blender_api.py import bpy class BlenderAPI: def create_cube(self): bpy.ops.mesh.primitive_cube_add() Delete a default cube from the scene. Now you can reload Blender code editor ("Alt+R+R") and run the code ("Alt + P"). You will see that a new code will be created: You can set breakpoints in "main.py" because there are mock-object for Blender API. And you can run unit tests using this command: python -m unittest You will see that unit test are passed.
  8. It is my example how to draw a triangle using WebGL and TypeScript: https://plnkr.co/edit/PkqSZGwhv9zKSnUNSiXo?p=preview Just fork my example, change it, save and send a new link to your friends. I use glMatrix library for math. You can find in the ShaderProgram.ts file hwo I set scale, rotation, and translation: let modelMatrix = mat4.create(); mat4.translate(modelMatrix, modelMatrix, vec3.fromValues(0, 0.5, 0)); mat4.rotateZ(modelMatrix, modelMatrix, 20.0 * Math.PI / 180.0); mat4.scale(modelMatrix, modelMatrix, vec3.fromValues(0.5, 0.5, 1)); let u_ModelMatrix = gl.getUniformLocation(this.program, "u_ModelMatrix"); gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix);
  9. 8Observer8

    Drawing Circles in OpenGL

    @calioranged, I wrote my code in Eclipse: Circle_GlfwLwjgl3OpenGL31Java.zip
  10. 8Observer8

    C# GUI WPF + OpenGL 3.1

    We will see how to place OpenTK.GLControl on WPF window to make GUI application with 2D/3D graphics using modern OpenGL 3. This is the result VS project: EditedTriangle_WPFOpenGL31CSharp.zip How to create the project from scratch Note 1: RMB - Right Mouse Button click Note 2: Good Color calculator for normalized values: http://doc.instantreality.org/tools/color_calculator/ Create WPF application, with the name "EditedTriangle". See the screenshot: Download OpenTK.GLControl.zip and OpenTK.zip Create the empty "Libs" folder in the solution folder (where the ".sln" is placed) Unzip "OpenTK" and "OpenTK.GLControl" folder in the "Libs" folder Add references to "OpenTK.dll" and "OpenTK.GLControl.dll". For this: RMB on "References" -> select "Add Reference..." -> select "Browse" -> click the "Browse..." button -> select DLL's. See the screenshot with the result: Add "Assemblies". For this: select "Assemblies" -> "Framework" -> check: System.Drawing System.Windows.Forms WindowsFormsIntegration , see the screenshot with the result: Click "OK" button Open the file "MainWindow.xaml" in VS. Add this line as an attribute of the "Window" element: xmlns:opentk="clr-namespace:OpenTK;assembly=OpenTK.GLControl" Place this code inside of <Window></Window> element: <Grid> <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Right"> <Button x:Name="buttonSetBGColor" Content="Set BG Color" Margin="5" Click="buttonSetBGColor_Click"></Button> <Button x:Name="buttonSetTRColor" Content="Set TR Color" Margin="5" Click="buttonSetTRColor_Click"></Button> </StackPanel> <WindowsFormsHost Margin="5" Initialized="WindowsFormsHost_Initialized"> <opentk:GLControl x:Name="glControl" Load="glControl_Load" Paint="glControl_Paint" /> </WindowsFormsHost> </DockPanel> </Grid> Copy the code below to "MainWindow.xaml.cs" and run the project MainWindow.xaml.cs using System; using System.Windows; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; namespace Triangle_OpenGL31WPF { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private Utils.ShaderProgram _program; private Matrix4 _projMatrix; private int _startIndex = 0; private int _amountOfVertices = 3; public MainWindow() { InitializeComponent(); } private void WindowsFormsHost_Initialized(object sender, EventArgs e) { glControl.MakeCurrent(); } private void glControl_Load(object sender, EventArgs e) { GL.ClearColor(new Color4(0.631f, 0.6f, 0.227f, 1f)); _program = new Utils.ShaderProgram( "Shaders/vShader.glsl", "Shaders/fShader.glsl"); if (_program.Id == -1) { MessageBox.Show(string.Format("Error: see the file \"{0}\"", Utils.Logger.logFileName)); return; } InitVertexBuffers(); SetTriangleColor(Color4.Red); int uProjMatrix = GL.GetUniformLocation(_program.Id, "uProjMatrix"); if (uProjMatrix < 0) { Utils.Logger.Append("Failed to get uProjMatrix location"); return; } _projMatrix = Matrix4.CreateOrthographicOffCenter(-1f, 1f, -1f, 1f, 1f, -1f); GL.UniformMatrix4(uProjMatrix, false, ref _projMatrix); } private void InitVertexBuffers() { float[] vertices = new float[] { // Triangle 0.0f, 0.5f, // (x, y) -0.5f, -0.5f, 0.5f, -0.5f }; // Create a vertex buffer object int vbo; GL.GenBuffers(1, out vbo); // Bind the VBO to target GL.BindBuffer(BufferTarget.ArrayBuffer, vbo); // Write the data into the VBO GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, BufferUsageHint.StaticDraw); // Get the storage location of the aPosition int aPosition = GL.GetAttribLocation(_program.Id, "aPosition"); if (aPosition < 0) { Utils.Logger.Append("Failed to get the storage location of the aPosition"); return; } // Assign the VBO to aPosition variable GL.VertexAttribPointer(aPosition, 2, VertexAttribPointerType.Float, false, 0, 0); // Enable the assignment GL.EnableVertexAttribArray(aPosition); } private void glControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { GL.Viewport(0, 0, glControl.Width, glControl.Height); // Fill a canvas GL.Clear(ClearBufferMask.ColorBufferBit); if (_amountOfVertices > 0) { GL.DrawArrays(PrimitiveType.TriangleStrip, _startIndex, _amountOfVertices); } // Swap the front and back buffers glControl.SwapBuffers(); } private void buttonSetBGColor_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.ColorDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { float r = dialog.Color.R / 255f; float g = dialog.Color.G / 255f; float b = dialog.Color.B / 255f; GL.ClearColor(new Color4(r, g, b, 1f)); glControl.Invalidate(); } } private void buttonSetTRColor_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.ColorDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { float r = dialog.Color.R / 255f; float g = dialog.Color.G / 255f; float b = dialog.Color.B / 255f; SetTriangleColor(new Color4(r, g, b, 1f)); glControl.Invalidate(); } } private void SetTriangleColor(Color4 color) { int uTriangleColor = GL.GetUniformLocation(_program.Id, "uTriangleColor"); if (uTriangleColor < 0) { Utils.Logger.Append("Failed to get uTriangleColor location"); return; } Vector3 c = new Vector3(color.R, color.G, color.B); GL.Uniform3(uTriangleColor, ref c); } } } MainWindow.xaml <Window x:Class="Triangle_OpenGL31WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Triangle_OpenGL31WPF" xmlns:opentk="clr-namespace:OpenTK;assembly=OpenTK.GLControl" mc:Ignorable="d" Title="Triangle" Height="256" Width="290"> <Grid> <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Right"> <Button x:Name="buttonSetBGColor" Content="Set BG Color" Margin="5" Click="buttonSetBGColor_Click"></Button> <Button x:Name="buttonSetTRColor" Content="Set TR Color" Margin="5" Click="buttonSetTRColor_Click"></Button> </StackPanel> <WindowsFormsHost Margin="5" Initialized="WindowsFormsHost_Initialized"> <opentk:GLControl x:Name="glControl" Load="glControl_Load" Paint="glControl_Paint" /> </WindowsFormsHost> </DockPanel> </Grid> </Window>
  11. 8Observer8

    which gui library

    I think it is not a good idea to use Qt and wxWidgets for games. He will spend a lot of time these frameworks but at the end he will understand that he need to load fonts (BMFont or FreeType) and he need to make his own buttons. It is not to complicated to make buttons. You can just load textures and draw them on rectangles to make letters and buttons.
  12. Loading a font from XML (BMFont) using TypeScript and XPath. Click to Run
  13. Description: Parsing XML .dae file using XPath query language that parse XML files Ambient + diffuse lighting Generating a new view matrix for camera rotation around an object Run it: Click to run in Browser (WebGL 1.0, TypeScript) Download the archive with EXE file: ColoredObjectFromCollada.zip (.NET 4, C#, OpenTK, OpenGL 3.1) Source code: WebGL 1.0, TypeScript (private repository) OpenGL 3.1, OpenTK, C# (private repository)
  14. @Rutin we motivate people and ourserve to learn useful things
  15. I think that one of the best way to learn programming is writing simple games using OpenGL 3+ (C#) and WebGL 1.0 (TypeScript). This is an awesome text tutorial to start: 2D Pong Game. But this tutorial uses legacy deprecated OpenGL 1.1. I rewrite a code from this tutorial to C# OpenGL 3.1 and TypeScript WebGL 1.0. You can play in the TypeScript WebGL 1.0 version by one click.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!