Форум программистов, компьютерный форум, киберфорум
Блог 8Observer8
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск  
Старый
Рейтинг: 5.00. Голосов: 1.
Определение клика мыши по объекту на JavaScript, TypeScript, WebGL, C# и OpenGL 3.1
Запись от 8Observer8 размещена 14.06.2019 в 01:43 / Блог 8Observer8
Показов 4602 Комментарии 2

Содержание блога

Советую книгу на русском из первого сообщения темы: Небольшие примеры на WebGL. Лучше читать сразу на английском, он в книге довольно простой: WebGL Programming Guide. Matsuda & Lea. По предыдущим ссылкам можно скачать архив с примерами к книге и запустить примеры в песочнице JSFiddle (через VPN). В книге используется самописная библиотека для работы с векторами и матрицами. Лучше взять намного более продвинутую glMatrix, которая всю необходимую...
Старый
Рейтинг: 5.00. Голосов: 1.
Рисование графика на примере синуса. WinForms, OpenGL 1.1, C#
Запись от 8Observer8 размещена 07.06.2019 в 01:40 / Блог 8Observer8
Показов 5865 Комментарии 0
Метки c#, opengl, winforms

Содержание блога

Цитата Сообщение от Temarot Посмотреть сообщение
1. Нарисовать на форме (на панели или другом элементе управления) график функции: параболу, синусоиду, гиперболу и т.д., но не прямую.
Название: Sin_WinFormsOpenGL11CSharp.gif
Просмотров: 2144

Размер: 13.5 Кб
Старый
Рейтинг: 5.00. Голосов: 1.
Инструкция, как сделать OpenTK.GLContro­l автономным от NuGet
Запись от 8Observer8 размещена 05.06.2019 в 11:09 / Блог 8Observer8
Показов 6257 Комментарии 0
Метки c#, opentk

Содержание блога

Цитата Сообщение от NadinKaa Посмотреть сообщение
Единственное, что С# требует пред.установки Фреймворка, что по ТЗ не желательно. но стоит подумать, возможно о совмещении в дальнейшем.
Меня часто спрашивают (нет), как сделать OpenTK автономным, то есть не требующий установки при запуске за другой машине.

Это пример на WinForms и OpenGL 1.1, в котором OpenTK.GLControl установлен...
Старый
Рейтинг: 5.00. Голосов: 1.
Активация Radeon и Geforce из EXE на ноутбуках для OpenGL 4 и C++
Запись от 8Observer8 размещена 02.06.2019 в 00:57 / Блог 8Observer8
Показов 2001 Комментарии 0
Метки c++, opengl

Содержание блога

На ноутбуках, например, на моём Asus K53SV, установлены две видеокарты:
  • маломощная Intel (OpenGL 3.1)
  • более мощная Geforce (OpenGL 4.6)

Это сделано для экономии энергии. Почти все приложения запускаются с маломощной, а игры запускаются с Geforce. Если вы хотите, чтобы EXE запускалось с OpenGL 4.6, то можно, например, в main.cpp, в начале файла, после include'ов добавить:
C++
1
2
// For Notebooks
// Enable running with High-performance NVIDIA Geforce processor
...
Старый
Рейтинг: 5.00. Голосов: 1.
Подключение GLFW, GLAD для OpenGL 3.1, C++ по относительным путям
Запись от 8Observer8 размещена 01.06.2019 в 17:49 / Блог 8Observer8
Показов 7297 Комментарии 0
Метки c++, opengl

Содержание блога

Главная цель проекта - показать, что можно создать проект в Visual Studio (в данном, случае в VS версии 2015), который можно скинуть кому-то и он будет работать сразу после открытия и запуска, потому что все библиотеки находятся в внутри проекта и подключены по относительным путям. Проект: EmptyWindow_GlfwOpenGL31Cpp.zip

Вторая цель - показать, как создать пустое окно. Третья - как использовать...
Старый
Рейтинг: 5.00. Голосов: 1.
Как нарисовать блок-схему с помощью DRAKON
Запись от 8Observer8 размещена 01.06.2019 в 13:11 / Блог 8Observer8
Показов 3340 Комментарии 0
Метки drakon

Содержание блога

https://drakonhub.com/

Краткое описание в PDF (124 страницы)

Видео: Как нарисовать ДРАКОН-схему в DrakonHub

Видео


Мой пример с условием, вводом и выводом: "День недели"
Старый
Рейтинг: 5.00. Голосов: 1.
Text. Legacy OpenGL 1.1, FreeGLUT, C++
Запись от 8Observer8 размещена 26.04.2019 в 11:29 / Блог 8Observer8
Показов 1836 Комментарии 0
Метки c++, opengl

Содержание блога

Цитата Сообщение от Stochfard Посмотреть сообщение
OpenGL C++ вывод текста. Подскажите самый простой способ вывести текст в определенном месте.
VS2015: Text_FreeGlutOpenGL15Cpp.zip

Settings

1.
Configuration: All Configurations
Platforms: All Platforms

C/C++ -> Genaral -> Additional Include Directories:
$(SolutionDir)Libs\freeglut-3.0.0-2\include

Linker -> Input -> Additional Dependencies
freeglut.lib

2.
...
Старый
Рейтинг: 5.00. Голосов: 2.
y = Sin(x). FreeGLUT, legacy OpenGL 1.1, C++
Запись от 8Observer8 размещена 26.04.2019 в 00:51 / Блог 8Observer8
Показов 2581 Комментарии 0
Метки c++, opengl

Содержание блога

Цитата Сообщение от Ений_В Посмотреть сообщение
Нужно создать график функции y = sinx.
Цитата Сообщение от DieSeele Посмотреть сообщение
Посоветуйте библиотеку для рисования графиков
VS2015: Sin_FreeGlutOpenGL11Cpp.zip
Release: Sin_x86_EXE.zip

Settings

1.
Configuration: All Configurations
Platforms: All Platforms

C/C++ -> Genaral
...
Старый
Рейтинг: 5.00. Голосов: 2.
Mock for "cube_add" Blender API
Запись от 8Observer8 размещена 05.03.2019 в 21:37 / Блог 8Observer8
Показов 3392 Комментарии 0
Метки blender, mock

Blog content

Mock-objects are useful if you use external editor like VSCode or IDE like PyCharm, Eclipse and so on, because you can use DI (Dependency Injection) and you can debug your code logic with breakpoints.

For example, we want to add a cube on a scene:

Python
1
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
...
Старый
Рейтинг: 5.00. Голосов: 1.
Update Projection Matrix. OpenGL 3.1, WinForms, C#
Запись от 8Observer8 размещена 28.02.2019 в 16:08 / Блог 8Observer8
Показов 2020 Комментарии 0
Метки c#, opengl, winforms

Blog content

This example shows how to update a projection matrix: Blackjack_WinFormsOpenGL31CSharp_UpdateProjMatrix.zip

C#
1
2
3
4
5
6
7
8
9
10
        private void glControl_Resize(object sender, EventArgs e)
        {
            UpdateProjMatrix();
        }
 
        private void UpdateProjMatrix()
        {
            float aspect = (float)glControl.Width / glControl.Height;
            float worldWidth = aspect * _worldHeight;
            // Define
...
Старый
Рейтинг: 5.00. Голосов: 1.
Textures. OpenTK.GLContro­l, WinForms, C#
Запись от 8Observer8 размещена 27.02.2019 в 20:24 / Блог 8Observer8
Показов 2778 Комментарии 0
Метки c#, opengl, opentk, winforms

Blog content

My example shows a simple way to draw a few textures using OpenGL 3.1 without writing you own engine like in previous instruction: BYO2DGE. 5.1 TextureShaders. C#

Project for Visual Studio: Blackjack_WinFormsOpenGL31CSharp.zip

You can use this example to start making card games.

Название: Blackjack_TwoCards.png
Просмотров: 2065

Размер: 29.6 Кб
Старый
Рейтинг: 5.00. Голосов: 1.
BYO2DGE. 5.1 TextureShaders. C#
Запись от 8Observer8 размещена 25.02.2019 в 19:25 / Блог 8Observer8
Показов 1832 Комментарии 0
Метки c#, opengl, winforms

Blog content

I study this book: Build your own 2D Game Engine. I rewrite the 2D game engine from the book from JavaScript to C#.

I rewrote this example from the official book repository: 5.1.TextureShaders to C#: ColoredAndTexturedObjects_OpenTKOpenGL31CSharp.zip

This example draw texture and color objects at the same time. You can move a tank by arrow keys and by WASD keys.

Нажмите на изображение для увеличения
Название: ColoredAndTexturedObjects.png
Просмотров: 470
Размер:	8.4 Кб
ID:	5232
Старый
Рейтинг: 5.00. Голосов: 1.
Specs for Node.js Calculator using Jasmine and JavaScript 5
Запись от 8Observer8 размещена 24.02.2019 в 20:37 / Блог 8Observer8
Показов 1391 Комментарии 0
Метки javascript, node.js

Blog content

Let's write an executable documentation for server side calculator.

Specifications:
  • "Add(a, b)" method must to sum positive numbers. Specification name: Add_SumPositiveNumbers_ReturnsSum
  • "Sub(a, b)" method must to subtract positive numbers. Specification name: Sub_SubtractPositiveNumbers_ReturnsSub

Instruction:
  • Create the "calculator-nodejs-jasmine-es5" folder
  • Run these commands to install Jasmine locally:
...
Старый
Рейтинг: 5.00. Голосов: 1.
Specifications for Calculator using Jasmine and JavaScript 5
Запись от 8Observer8 размещена 23.02.2019 в 15:14 / Блог 8Observer8
Показов 1358 Комментарии 0
Метки javascript

Blog content

Specifications:
  • "Add(a, b)" method must to sum positive numbers. Specification name: Add_SumPositiveNumbers_ReturnsSum
  • "Sub(a, b)" method must to subtract positive numbers. Specification name: Sub_SubtractPositiveNumbers_ReturnsSub

Source Code: https://github.com/8Observer8/... asmine-es5

Instruction:
  • Create the "calculator-jasmine-es5" folder
  • Search in the Internet: cdn jasmine
  • Create the "SpecRunner.html
...
Старый
Рейтинг: 5.00. Голосов: 1.
Specifications for Calculator using Jasmine and TypeScript
Запись от 8Observer8 размещена 23.02.2019 в 01:08 / Блог 8Observer8
Показов 1711 Комментарии 0
Метки typescript

Blog content

In this instruction we will study how to write executable specifications for a very simple Calculator project using Jasmine testing framework.

Source code on GitHub: https://github.com/8Observer8/... wserify-ts

If you do not have "browserify" then install it globally using this command:
npm install browserify -g
Note. You can read about why we need "browserify" in this project in my...
Старый
Рейтинг: 5.00. Голосов: 1.
Browserify TypeScript + Bonus: UglifyJS
Запись от 8Observer8 размещена 21.02.2019 в 18:32 / Блог 8Observer8
Показов 1619 Комментарии 0
Метки typescript

Blog content

It is the most common problem for anyone who starts to study TS. They cannot include a few ".js" files after compilation to <script> tags in "index.html".

It is very simple in JS. You have two files in JS and you can include them in "index.html"

PHP/HTML
1
2
3
4
5
<html>
 
<head>
    <script src="js/sayHello.js"></script>
    <script src="js/main.js"></script>
...
Старый
Рейтинг: 5.00. Голосов: 1.
A few TypeScript files on Sandbox
Запись от 8Observer8 размещена 20.02.2019 в 17:27 / Блог 8Observer8
Показов 1462 Комментарии 0
Метки typescript

Blog content

There is a few TypeScript files in our example. We want to place these scripts on Sandbox.

This is the result on the Sandbox: click. Open the debug console in your browser to see the result: "Ctrl+Shift+J" in Chrome.

You will see in the debug console this messages:
Rectangle was created
Rectangle was drawn
Create these files on Sandbox: https://plnkr.co/edit/

Program.ts

JavaScript
1
import
...
Старый
Рейтинг: 5.00. Голосов: 1.
GUI WPF + OpenGL 3.1 + C#
Запись от 8Observer8 размещена 19.02.2019 в 17:36 / Блог 8Observer8
Показов 3998 Комментарии 0
Метки c#, opengl, wpf

Blog content

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_Result.png
Просмотров: 1940

Размер: 4.3 Кб

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/... alculator/
  • Create WPF application, with the name "EditedTriangle".
...
Старый
Рейтинг: 5.00. Голосов: 1.
Set Up Google Mock Framework for TDD. C++, Visual Studio
Запись от 8Observer8 размещена 19.02.2019 в 02:46 / Блог 8Observer8
Показов 2668 Комментарии 0

Blog content

If you need the example how to set up GTest without GMock you can see this example: Set Up GTest, TDD, C++, VisualStudio

In this example: PersonService_GMockCpp.zip we will see how to use Google Mock for creating mock objects and how to write a unit test for testing exceptions. I translated this example from the TypeScript tutorial: Using Jasmine Spies to Create Mocks and Simplify the Scope of Your Tests

You can download and run the example. Google...
Старый
Рейтинг: 5.00. Голосов: 1.
Set Up OpenGL 3 for Python
Запись от 8Observer8 размещена 18.02.2019 в 17:41 / Блог 8Observer8
Показов 3566 Комментарии 0
Метки opengl, python

Blog content

You need to type commands in the console terminal (you need to run the console terminal as administrator):

pip install GLFW
pip install PyOpenGL
pip install Pyrr
pip install NumPy
Pyrr - for trigonometry and linear algebra
NumPy - for special arrays for OpenGL functions
You will see how to use these libraries in video tutorial below.

Now you are ready to create simple games in Python and OpenGL. See this...
Старый
Рейтинг: 5.00. Голосов: 1.
Deploying Game Server on Heroku
Запись от 8Observer8 размещена 17.02.2019 в 20:58 / Блог 8Observer8
Показов 1631 Комментарии 0
Метки gamedev, heroku, javascript

Blog content

Heroku is a free hosting. Let's deploy the application from this instruction: Emit and Broadcast JSON using Socket.io and JS/ES5

You need to register on https://heroku.com/ and complete this official instruction: Getting Started on Heroku with Node.js

Go here: https://dashboard.heroku.com/apps and create a new application. For this you need to press "New" button in right top corner. Select "create new app". I created a new application...
Старый
Рейтинг: 5.00. Голосов: 1.
Emit and Broadcast JSON using Socket.io and JS/ES5
Запись от 8Observer8 размещена 17.02.2019 в 18:36 / Блог 8Observer8
Показов 1521 Комментарии 1
Метки javascript, json, socket.io

Blog content

I will show differences between "emit" and "broadcast" on server side.

In short:
  • "emit" sends JSON data to a connected client
  • "broadcast" sends JSON data to every client except the connected client

At first time create a connection between the server and the client using this instruction: 101. Socket.io Connection, JS/ES5

We have this callback function in "app.js":

JavaScript
1
io.sockets.on("connection",
...
Старый
Рейтинг: 5.00. Голосов: 1.
Socket.io Connection, JS/ES5
Запись от 8Observer8 размещена 15.02.2019 в 17:59 / Блог 8Observer8
Показов 1815 Комментарии 1
Метки javascript, socket.io

Blog content

I will try to explain a process in step-by-step how to prepare server but it will be good if you will watch this video tutorial in parallel: Setup & Sending Files. Node.js Tutorial Guide
Youtube


You need to download and install Node.js: https://nodejs.org/en/download/

At first test let's create a very simple server script locally that will write in the console terminal*"client connected" when client will be connected to...
Старый
Рейтинг: 5.00. Голосов: 1.
Use UML Instead Of Flowcharts
Запись от 8Observer8 размещена 14.02.2019 в 22:38 / Блог 8Observer8
Показов 1395 Комментарии 0
Метки uml

Blog content

Updated: 2/14/2019
- added "if...else" Double-Selection Statement

Visual Studio Enterprise 2015 has build in tool for creating UML Activity Diagrams. We can use this tool for creating flowcharts for describing algorithms.

Creating UML Activity Diagram:
  • Select: "File" -> "New" -> "Project..." -> "Modeling Projects"
  • Write a name, for example: UseUMLInsteadOfFlowcharts_ModelingProjec t
  • Press
...
Старый
Рейтинг: 4.50. Голосов: 2.
Set Up Google Test Framework for TDD. C++, Visual Studio
Запись от 8Observer8 размещена 13.02.2019 в 13:53 / Блог 8Observer8
Показов 2521 Комментарии 3
Метки c++, tdd, unit-test, visual studio

Blog content

Before I will start I want to advise you to read this book:*The Art of Unit Testing: with examples in C#. Yes, as you can see this book contains examples in C# but it is not important. This book contain very useful and important information how to write unit tests.

I made an example of project in VS 2015: SortFunctions.zip This project will show you how set up Google Test in Visual Studio and run simple unit tests.

Note. If you have another version...
Старый
Рейтинг: 5.00. Голосов: 2.
Пример, как использовать GUI WinForms вместе с OpenGL 3.1
Запись от 8Observer8 размещена 11.02.2019 в 20:31 / Блог 8Observer8
Показов 3451 Комментарии 2
Метки c#, opengl, winforms

Содержание блога

Пример, как использовать GUI WinForms вместе с OpenTK.GLControl и OpenGL 3.1



Стандартный диалог цвета при нажатии на кнопки для смены цветов:

Старый
Рейтинг: 5.00. Голосов: 1.
Step-by-step instruction of Snake 2D using C#, WinForms, OpenGL 3.1
Запись от 8Observer8 размещена 10.02.2019 в 22:56 / Блог 8Observer8
Показов 7885 Комментарии 1
Метки c#, opengl, winforms

Blog content

We will place OpenTK.GLControl on the Form to draw graphics with modern shader OpenGL 3.1.

This is a gif animation of the final result of our work:

Название: Snake_WinFormsOpenGL31CSharp_MovingSnake.gif
Просмотров: 3128

Размер: 20.7 Кб

Note. I take ideas from this tutorial: Python Snake Game

Please, download this empty project: Snake_WinFormsOpenGL31CSharp.zip. It includes OpenTK.dll and OpenTK.GLControl.dll

Or if you know how to add libraries from References and how to add Control...
Старый
Рейтинг: 5.00. Голосов: 1.
Replacement of Canvas API with WebGL in the Snake Game
Запись от 8Observer8 размещена 08.02.2019 в 14:56 / Блог 8Observer8
Показов 2324 Комментарии 6
Метки canvas, webgl

Blog content

I just show how to rewrite drawRectangle(x, y, color, size) function from the instruction for drawing with WebGL instead of Canvas API.

Include gl-Matrix. If you will search: gl-matrix cdn you will find this: https://cdnjs.com/libraries/gl-matrix We need gl-Matrix for setting positions and sizes of squares. We will set coordinate cell and camera position using gl-Matrix functions: ortho and lootAt.

Let's include gl-Matrix, get WebGL context and...
Старый
Рейтинг: 5.00. Голосов: 2.
GameDev books that I study
Запись от 8Observer8 размещена 07.02.2019 в 22:45 / Блог 8Observer8
Показов 1412 Комментарии 0
Метки eng, gamedev

Blog content

Updated 3/4/2019

I study how to write my own game engines using modern/shader OpenGL + C# and WebGL + JS5 (and TypeScript). I advice you this book: C# Game Programming: For Serious Game Creation. This book shows how to write your own game engine with maintainable code using TDD. This is a great book. It is not for GameDev only. It shows how to develop big projects in general. I know that you like to write games using Game Engines like Unity. By this book you...
Старый
Рейтинг: 5.00. Голосов: 1.
How to write a prototype of the Snake Game using JavaScript/ES5, HTML5 Canvas API
Запись от 8Observer8 размещена 06.02.2019 в 21:49 / Блог 8Observer8
Показов 1764 Комментарии 0
Метки canvas, html, javascript

Blog content

Let's make a very simple classic snake game. For example, if we have a snake head with 10x10 pixels then we will move our snake by a step with 10 pixels using timer.

Create a "index.html" file with a canvas element and set the size for the canvas element:

PHP/HTML
1
2
3
4
5
6
7
8
<!DOCTYPE html>
 
<head>
    <title>Snake</title>
</head>
 
<body>
    <canvas width="200" height="200"
...
Новые блоги и статьи
Часы электронные
Uhbif79 12.08.2026
Выкладываю программу часов. Программа позволяет: 1. Использовать системное время и дату, 2. Есть возможность вводить время и дату вручную. 3. Реализованы 2 будильника: начало и конец рабочего дня. . . .
Часы с будильником на основе класса QLCDNumber
Uhbif79 12.08.2026
Всем добрый день, выкладываю программу часов с будильником на основе класса QLCDNumber. Здесь я пробовал самостоятельно создавал классы, впервые столкнулся с видимостью переменной одного класса из. . .
Установка MinGW GCC 16.2 и CMake
8Observer8 10.08.2026
VK Видео: https:/ / vkvideo. ru/ video-240781534_456239017 YouTube: eY5-5PyI9NM Текстовая версия
Неделя из жизни имитационной модели склада: мои кривые руки растут, откуда надо
anaschu 10.08.2026
Неделя из жизни имитационной модели склада: как я почти написал неправильную логику и что с этим делать Работаю сейчас над учебно-рабочим проектом: строю в AnyLogic имитационную модель процессов. . .
Калькулятор для расчета родства
russiannick 07.08.2026
1. Задача: Создать калькулятор для расчета родства. Родственных связей существует 8 ступеней, такие как: p - отец P - мать q - муж Q - жена b - брат B - сестра s - сын S - дочь
Мир по моей воле
kumehtar 07.08.2026
Когда-то кажется, что всё просто. Ты весь такой светлый. Причиняешь добро. Борешься за справедливость в этом тёмном мире. Потом начинаешь замечать одну неприятную вещь. Почти каждый хороший. . .
Кредитный калькулятор
Maks 05.08.2026
Решение задачи по прикладной информатике средствами 1С. Задача: Напишите приложение-калькулятор, которое помогает рассчитывать параметры кредита для аннуитетного и дифференцированного видов. . .
У нас сейчас поговорку "Опять 25" нужно переделать на "Опять +35".
kumehtar 04.08.2026
С ностальгией вспоминаю времена моего детства, когда у нас и правда +25 - была максимальная температура летом. Раньше +25 °C реально казались вершиной жары, когда можно было весь день пропадать на. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru