mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Noise Test function, adjust chat position
This commit is contained in:
parent
27540f1286
commit
be1b803656
4 changed files with 29 additions and 2 deletions
|
@ -62,8 +62,8 @@ bool usingBigSphereCollisionTest = true;
|
|||
|
||||
char iris_texture_file[] = "resources/images/green_eye.png";
|
||||
|
||||
float chatMessageScale = 0.001;
|
||||
float chatMessageHeight = 0.4;
|
||||
float chatMessageScale = 0.0015;
|
||||
float chatMessageHeight = 0.45;
|
||||
|
||||
vector<unsigned char> iris_texture;
|
||||
unsigned int iris_texture_width = 512;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <cstring>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/noise.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
#include <SharedUtil.h>
|
||||
|
||||
|
@ -112,6 +113,28 @@ void drawVector(glm::vec3 * vector) {
|
|||
|
||||
}
|
||||
|
||||
// Render a 2D set of squares using perlin/fractal noise
|
||||
void noiseTest(int w, int h) {
|
||||
const float CELLS = 100;
|
||||
float xStep = (float) w / CELLS;
|
||||
float yStep = (float) h / CELLS;
|
||||
glBegin(GL_QUADS);
|
||||
for (float x = 0; x < (float)w; x += xStep) {
|
||||
for (float y = 0; y < (float)h; y += yStep) {
|
||||
// Generate a vector varying between 0-1 corresponding to the screen location
|
||||
glm::vec2 position(x / (float) w, y / (float) h);
|
||||
// Set the cell color using the noise value at that location
|
||||
float color = glm::simplex(position);
|
||||
glColor4f(color, color, color, 1.0);
|
||||
glVertex2f(x, y);
|
||||
glVertex2f(x + xStep, y);
|
||||
glVertex2f(x + xStep, y + yStep);
|
||||
glVertex2f(x, y + yStep);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void render_world_box() {
|
||||
// Show edge of world
|
||||
glDisable(GL_LIGHTING);
|
||||
|
|
|
@ -40,6 +40,8 @@ void drawtext(int x, int y, float scale, float rotate, float thick, int mono,
|
|||
void drawvec3(int x, int y, float scale, float rotate, float thick, int mono, glm::vec3 vec,
|
||||
float r=1.0, float g=1.0, float b=1.0);
|
||||
|
||||
void noiseTest(int w, int h);
|
||||
|
||||
void drawVector(glm::vec3* vector);
|
||||
|
||||
float angleBetween(glm::vec3 * v1, glm::vec3 * v2);
|
||||
|
|
|
@ -893,6 +893,8 @@ void displayOverlay() {
|
|||
audioScope.render();
|
||||
#endif
|
||||
|
||||
// noiseTest(WIDTH, HEIGHT);
|
||||
|
||||
if (displayHeadMouse && !::lookingInMirror && statsOn) {
|
||||
// Display small target box at center or head mouse target that can also be used to measure LOD
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
|
|
Loading…
Reference in a new issue