Tag Archives: ProgrammerAH

Record the problems encountered in OpenGL learning

1. When passing data to a uniform in a shader, the ID of the shader must be bound first, that is, gluseProgram (ID), and the operation must be next to each other. If another shader is bound in the middle, then the data passed will have problems.
2, Normal =mat3(transpose(inverse(model)) *aNormal; 2, Normal =mat3(transpose(inverse))*aNormal;
3. In matrix transformation, generally scale ->; Rotation – & gt; Translation, in turn, transform the modelMat = modelData scale rotate translate * * *, but when using GLM library of built-in method, need to write, in turn, see https://blog.csdn.net/wangdingqiaoit/article/details/51531002 specific reasons, at the same time is highly recommended to see the great god of the tutorial.
Error :gl.h included before glew.h :gl.h included before glew.h: error:gl.h included before glew.h gl/glew.h> Put it on top.

Reproduced in: https://www.cnblogs.com/stigerzergold/p/10965005.html

Visual studio 2017, OpenGL program running prompt glut32.dll missing solution

From: http://blog.csdn.net/liufeng520/article/details/8064170
My question is exactly the same as above, so make a note of it for later review and reference.
Today debug OpenGl source program, compiled through, but a running tips, computer lost glut32. DLL files, not depressed, search under the Internet provide most of the practice are more, copying the file to download this file to C: \ WINDOWS \ system in 32, but did so after found that still doesn’t work, after a long afternoon, suddenly realized that may be about my new WINDOWS 7 system, but also for loading is 64 – bit, then, Try to copy this glut32.dll to your SysWOW64 folder in C:\ Windows, and it will all be OK. Here’s a special note to remind everyone who installed Windows 7 and VC ++ 6.0 to pay attention to it.
PS: When I just started to contact OpenGL, I will inevitably encounter some problems. These problems may have nothing to do with the program, but some compilation environment Settings and header file installation. In particular, I have arranged them as follows:
(1) Copy gult32.dll, Glut. DLL to Windows system system32(if Windows 7 is a 64-bit operating system, it is in C:\ Windows SysWOW64 file)
(2) Copy gult32.lib, Glut. lib to VC lib directory
(3) Copy ULT. H to include\GL of VC

The first day of OpenGL [vs2017 + OpenGL environment configuration]

The OpenGL environment has been configured several times without success.
Today, I finally tried it, so I shared it, so that others can avoid detours.
My tool is VS2017
1. Method (download various library files)
Download the required files for OpenGL
http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
Then you get five files:
Glut.dll Glut.dll Glut.Lib Glut.h
Find the directory.. \VC\Tools\MSVC\14.10.25017\include\gl So let’s put Glut.H in there.
 

Find the directory.. \VC\Tools\MSVC\14.10.25017\lib\x86 Glut. lib, Glut32.lib

Finally, the
Glut. DLL and glut32.dll go in

C: \ Windows \ system32 folder (32-bit system) or ‪ C: \ Windows \ SysWOW64 (64 – bit systems).

 
2. Methods (using VS plug-ins)
Open VS and create a C++ project (Win32 Console – Blank Project)
Then click Project – Manage the NuGet package
Then click Browse – type Nupengl in the search bar
Then install (two if you have two)
——————————————————
One final test:
 

(plain)
The view plain
copy

 

The

    # include & lt; GL/glut.h> Void the Show () {glClear (GL_COLOR_BUFFER_BIT); GlRectf (0.5-0.1 f to 0.1 f, f, 0.5 f); GlFlush (); } int main (int arg c, char * argv []) {glutInit (& amp; Arg c, argv); GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE); GlutInitWindowPosition (100, 100); GlutInitWindowSize (400, 400); OpenGL glutCreateWindow (” “); GlutDisplayFunc (Show); GlutMainLoop (); Return 0; }

     
    Run it and you’ll see a white square

    If there are no errors, the configuration is successful!
    (if you try and succeed, remember thumb up ah )

Vs2017 installing OpenGL

The project name – & gt; Manage NUGET packages ->; Browse – & gt; Search Nupengl, download and install it. Reference blog:

https://blog.csdn.net/HY_JT/article/details/79482556 can also refer to the blog: https://blog.csdn.net/yinglang19941010/article/details/50166343

#include <cstdio>
#include <GL/glew.h>
#include <GL/freeglut.h>

#pragma comment(lib, "glew32.lib")

void displayFunction()
{
	glClear(GL_COLOR_BUFFER_BIT);
	glRectf(-0.5, -0.5, 0.5, 0.5);
	glColor3f(0.0, 1.0, 0.0);
	glFlush();
};

int main(int argc, char *argv[])
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
	glutInitWindowSize(600, 600);
	glutCreateWindow("The first OpenGL Application");

	glewExperimental = true;
	glewInit();

	printf("OpenGL version: (%s) \n", glGetString(GL_VERSION));
	glutDisplayFunc(&displayFunction);
	glutMainLoop();

	return 0;
}

Solution to the error of win7 & win10 shared printer 0x000000709

The printer installation is normal and the sharing is normal. However, when adding the sharing via // IP/printer name, the 709 error occurred. At first, I thought it was the problem of PrintSpooler service, but it still failed.
Finally found the problem is that the server computer name is too long ———-!!!!!!!!!!!!!!!!
Modify the computer named compliance length, restart the server, and the client directly adds the shared printer. Successfully.

Reproduced in: https://blog.51cto.com/lancatsky/2054715

2017 vs can’t reference problem solution

preface: the recent computer room cooperation to the coding stage, in this stage need to unify the version of VS, so I downloaded a 17 version of VS, but when the reference but reported an error, the following is the solution, to share with you.
>
>

>2
VS2017 add reference error: call to COM component returns error HRESULT E_FAIL
> (2) solution
1. Open Developer Command Prompt for VS 2017 as an administrator
Developer Command Prompt for VS 2017 has been searched for a long time, but it has been found in the lower left corner of the desktop. The Developer Command Prompt for VS 2017 can be found by following the following steps: “Developer Command Prompt for VS 2017”, select “More”, and then “Run as an Administrator”.

2. Locate your VS2017 installation directory
Once the first step is complete, the screen pops up.

Enter the following information:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies

CD C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies
Be sure to put [CD] before the position.
3. Execute the following code
Gacutil. -i Microsoft VisualStudio. Shell. Interop. 11.0 DLL
this is completed.
summary: for the same problem sometimes online solutions are very similar, but often can not find their own online solution location, so we must write in detail when writing a blog, after all, the blog is for others to see, convenient for others is to facilitate their own. Of course, if the solution situation is not the same as the problem you have to try.

Pits encountered during installation of vs2017

In the VS official website to download the installation package, the results repeatedly download resources, the installation progress bar has not been moving, reinstall, copy a variety of methods have tried, still not……
Later, I noticed that the download needed to be verified after completion, and I felt that there was an error during the verification, so I downloaded it. The following is the solution
1. Run the command line and type the command gpedit.msc
2. Open the Local Group Policy Editor and find Windows Settings
3. Open Windows Settings and find Security Settings ->; The local policy
4, find the security option – system secret ->; Use FIPS compatible algorithms for encryption, hashing, and signature – set to disable
5. Right-click on the property and set it to Disable
6, then click the VS2017 installation package again will not prompt the signature failed, you can install

Unknown code: GB18030

The Linux installation of Python 3.5.2 encountered the following error
Could not find platform dependent libraries < exec_prefix>
Consider setting $PYTHONHOME to < prefix> [:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: unknown encoding: GB18030
 
Solution:
Before the web.config
Export LANG= zh_cn.utf-8
export LANGUAGE= zh_cn.utf-8

Could’t find path to unrear Library

The original link: https://blog.csdn.net/ysy950803/article/details/52939708
Win:

    to RARLab first official download library files, http://www.rarlab.com/rar/UnRARDLL.exe, and installation; The best way to install is to choose the default path, usually in the C: Program Files (x86)\UnrarDLL\ directory; Then the important step is to add the environment variable, this computer (my computer) right click, properties, find advanced system Settings, advanced TAB under the environment variable, in the system variable (note not user variable) new, variable name input UNRAR_LIB_PATH, must be exactly the same, the value of the variable should pay special attention to! If you are a 64-bit system, type C:\Program Files (x86)\ Unrardll \x64\ Unrar64.dll, if you are a 32-bit system, type C:\Program Files (x86)\ Unrard.dll. Once you’re sure to save the environment variables, restart your PyCharm with the same code, and run it error-free. At this point the dependent libraries have been added to the system environment.

Linux needs to manually compile and generate the SO file itself, which is a bit more cumbersome:

    in the same way, the first to download the Source file, but it’s not like a Win for you packaging good, you need to download the Source code: http://www.rarlab.com/rar/unrarsrc-5.4.5.tar.gz, namely RARLab website to download the list of UnRAR Source, you can download the latest version; Make install-lib will automatically compile the library files. After the compilation is complete, use make install-lib to generate the libunrar.so file (normally located under /usr/lib). Finally, you still need to set the environment variable of your Linux system, find the profile file in the /etc/profile directory, which you can edit directly using the Vim /etc/profile command (even easier with WinSCP), add export UNRAR_LIB_PATH=/usr/lib/libunrar.so at the end of the profile, don’t put the comma in it. Save the variable successfully and then use the source /etc/profile command to make the variable effective. This way, if you run the py file again, you won’t get an error, at least you won’t be told that you can’t find the unrar library.

Sudo apt-get install g++ : sudo apt-get install g++ : sudo apt-get install g++ : sudo apt-get install g++ : sudo apt-get install
Source: author: acerola
CSDN
,
https://blog.csdn.net/ysy950803/article/details/52939708 copyright statement: this article original articles for bloggers, reproduced please attach link to blog!