Giter Club home page Giter Club logo

examples's People

Contributors

grahamsellers avatar johnkslang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

cannot build on linux

Hello.
I'm using ubuntu 14.04.5 and the code cannot be compiled.
First i did cmake on build/ folder.

$ cmake ..

Then make fails:

$ make
[ 14%] Built target glfw
[ 15%] Building CXX object CMakeFiles/vermilion.dir/lib/LoadShaders.cpp.o
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp: In function ‘const GLchar* ReadShader(const char*)’:
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:26:42: error: ‘fopen’ was not declared in this scope
FILE* infile = fopen( filename, "rb" );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:36:23: error: ‘SEEK_END’ was not declared in this scope
fseek( infile, 0, SEEK_END );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:36:32: error: ‘fseek’ was not declared in this scope
fseek( infile, 0, SEEK_END );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:37:29: error: ‘ftell’ was not declared in this scope
int len = ftell( infile );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:38:23: error: ‘SEEK_SET’ was not declared in this scope
fseek( infile, 0, SEEK_SET );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:42:35: error: ‘fread’ was not declared in this scope
fread( source, 1, len, infile );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:43:20: error: ‘fclose’ was not declared in this scope
fclose( infile );
^
make[2]: *** [CMakeFiles/vermilion.dir/lib/LoadShaders.cpp.o] Error 1
make[1]: *** [CMakeFiles/vermilion.dir/all] Error 2

Whats the license status of this source code

There is no license information given for the source code in this repository which means that it is fully copyrighted and you must not even execute it. Does anyone know anything about the license status?

Need help and support for vs 2015?

The code can be compiled by vs 2015, but many project was crash when the start running those exe. Any suggest for this?

Book users from China, Perry, 2016/10/09

Figure 9.1 does not match with example 9.3

Hi,

Figure 9.1 show a Tessellation Quad based on the example given in Example 9.3.
The Example states
gl_TessLevelOuter[0] = 2.0;
gl_TessLevelOuter[1] = 3.0;
gl_TessLevelOuter[2] = 2.0;
gl_TessLevelOuter[3] = 5.0;

While the example states that gl_TessLevelOuter[3] is 5, based on the image it should be equal to 4.0.
possibleError

glCreate* and glGen*

I noticed that many of your examples go back and forth between setting up using glGen and glCreate is there a preferred method?

what is the order of "glVertexAttribPointer" and "glEnableVertexAttribArray"?

In most case, the code is following the order "glVertexAttribPointer" first and then "glEnableVertexAttribArray". I think the interface "glVertexAttribPointer" is used to connect the buffer (managed by OpenGL) and the attrib (shader mananged by the pipeline), while the "glEnableVertexAttribArray" is used to submit the attachment to VAO then VAO can dispatch the buffer to related attribute, or vise vista.

But in Line 94 of "09-teapot.cpp"(and also the code for chapter 12 has the inverse order), the program is arranged in the inverse order
"void TeapotExample::Initialize(const char * title)
{
....
Line 94:
glEnableVertexAttribArray( vPosition );
glVertexAttribPointer( vPosition, 3, GL_FLOAT, GL_FALSE, 0,
BUFFER_OFFSET(0) );
"
well, is the latter usage correct, or what happen when glEnableVertexAttribArray is called?

Codes do not match the 9th edition.

The 9th edition introduces the opengl 4.5 and prefers to use DSA methods (such as glCreate*).
But these demo codes are still not updated and do not match source codes on the 9th edtion redbook.

In Line 114 of "11-doublewrite.cpp"

void DoubleWriteExample::Initialize(const char * title) ... glBindImageTexture(0, output_texture, 0, GL_TRUE, 0, GL_READ_WRITE, GL_RGBA32F); ...
while 0 refers to the image unit (in fragment shader) which used as input and should be initialized by the render pipeline. what does this statement mean?

Many compilation errors on Ubuntu 18.04 compiling with GCC 7.5.0

Excited to receive the book. Disappointed to clone the examples and find that they simply did not build at all.

There are several errors in which memset or memcpy is not declared in scope. Can be fixed by including . I was also required to include <time.h> or <sys/time.h> here and there because some struct was declared but not defined.

There are several errors in which goto by passes the initialisation of local variables in a vglLoadDDS(). This might be legal C but is not C++, and the file is called vdds.cpp. I moved the declarations. But seriously? I haven't used goto in thirty years, if ever.

The particle simulator shader program made use of a STRINGIZE macro, which totally failed on the #version directive. All other examples appear to simply concatenate quoted strings.

My changes were just hacked in, so I won't submit a pull request.

build problem

1>gl3w.obj : error LNK2019: 无法解析的外部符号 __imp__wglGetProcAddress@4,该符号在函数 _get_proc 中被引用
1>C:\Users\zhongUUA\Documents\Visual Studio 2015\project\Red book TH9\第一章 OpenGL 概述\1 - 1 初识OpenGL程序\Debug\1 - 1 初识OpenGL程序.exe : fatal error LNK1120: 1 个无法解析的外部命令!

lib and include are configured,
gl3w and glfw are configured,
how to solve this problem?
WTF

Is there any documents that describes the correspondence between the source and textbook?

To the best of my knowledge, there is no such correspondence description in the text/RedBook except the first program. The only hint is the two digits prefixing the directory and file names in the src folder. The remaining is guesswork. Although all my guess are correct so far, I still hope there is an official document that gives me such a correspondence between the source and textbook. For example, 01-keypress.cpp corresponds to what section(s) of the RedBook. Or, if such a doc exists but I missed it, please kindly let me know. I would appreciate this doc.

`03-pointsprites` does not correctly render the point sprite texture

03-pointsprites displays white squares instead of texture data of sprite2.tga.
I found that adding the following lines to the vermilion.cpp fixes the problem.

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

Can someone look into this please?
Thank you.

Problem in vmath::lookat

There is a problem in vmath.h:1060.
template
static inline Tmat4 lookat(const vecN<T,3>& eye, const vecN<T,3>& center, const vecN<T,3>& up)
{
const Tvec3 f = normalize(center - eye);
const Tvec3 upN = normalize(up);
const Tvec3 s = cross(f, upN);
const Tvec3 u = cross(s, f);
const Tmat4 M = Tmat4(Tvec4(s[0], u[0], -f[0], T(0)),
Tvec4(s[1], u[1], -f[1], T(0)),
Tvec4(s[2], u[2], -f[2], T(0)),
Tvec4(T(0), T(0), T(0), T(1)));

return M * translate<T>(-eye);

}

I think we must guarantee that vector s and vector u are normalized, otherwise we cannot ensure matrix M is correct.(And in fact in some cases, M is incorrect).
So I changed them into:
const Tvec3 s = normalize(cross(f, upN));
const Tvec3 u = normalize(cross(s, f));

vbm file

I want to know what is the vbm file (the suffix is vbm) and how to open it?

How to build in ubuntu system?

Could anyone tell me how to build this project in ubuntu? Can I build in the traditional way as "mkdir build cd build cmake .. make"? I did this .But a lot of errors happen.I don"t know why.

[ 15%] Building CXX object CMakeFiles/vermilion.dir/lib/LoadShaders.cpp.o /home/wangwei/1编程指南-master/lib/LoadShaders.cpp: 在函数‘const GLchar* ReadShader(const char*)’中:

when I compile this code in linux CENTOS7
/home/wangwei/1编程指南-master/lib/LoadShaders.cpp:26:42: 错误:‘fopen’在此作用域中尚未声明
FILE* infile = fopen( filename, "rb" );
^
/home/wangwei/1编程指南-master/lib/LoadShaders.cpp:36:23: 错误:‘SEEK_END’在此作用域中尚未声明
fseek( infile, 0, SEEK_END );
^
/home/wangwei/1编程指南-master/lib/LoadShaders.cpp:36:32: 错误:‘fseek’在此作用域中尚未声明
fseek( infile, 0, SEEK_END );

The title of error

regex.h namespace compiling error

Hello Authors,
When running make all I'm getting an error compiling context.c which imports a joystick header that in tern imports regex.h which is declaring a namespace. Screenshot enclosed.

Thoughts?

Screenshot 2023-04-06 at 4 18 11 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.