 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_GRAPHICS_UTILITY_H
26 #define SHKZ_GRAPHICS_UTILITY_H
58 for(
unsigned t=0; t<num_v; t++ ) {
59 double theta = 2.0 * M_PI * t / (double)num_v;
60 g.
vertex2(p[0]+r*cos(theta),p[1]+r*sin(theta));
75 double y_vec_x = p1[0]-p0[0];
76 double y_vec_y = p1[1]-p0[1];
77 double y_vec_len = hypot(y_vec_x,y_vec_y);
83 double x_vec_x = -y_vec_y;
84 double x_vec_y = y_vec_x;
85 double k = 0.25*y_vec_len;
92 vec2d p2(p1[0]+k*0.8*x_vec_x-k*y_vec_x,p1[1]+k*0.8*x_vec_y-k*y_vec_y);
93 vec2d p3(p1[0]-k*0.8*x_vec_x-k*y_vec_x,p1[1]-k*0.8*x_vec_y-k*y_vec_y);
114 const double p0[] = { 0.0, 0.0, 0.0 };
115 const double p1[] = { scale, scale, scale };
void vertex2v(const T *v)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:235
static void draw_wired_box(graphics_engine &g, double scale=1.0)
Draw a wired box of a unit size.
Definition: graphics_utility.h:113
virtual void end()=0
Equivalebt to glEnd. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glEnd....
Class that provides various utility functions for graphics.
Definition: graphics_utility.h:38
void vertex3(double x, double y, double z)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:181
@ LINES
Independent lines segmemts.
T v[D]
Vector value array.
Definition: vec.h:44
void vertex2(double x, double y)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:173
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
MODE
List of drawing mode that is to be specified with begin() function. See https://www....
Definition: graphics_engine.h:188
Fixed sized vector structure.
Definition: vec.h:38
static void draw_wired_box(graphics_engine &g, const T *p0, const T *p1)
Draw a wired box.
Definition: graphics_utility.h:128
@ TRIANGLES
Independent triangles.
virtual void begin(MODE mode)=0
Equivalebt to glBegin. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glBegin....
static void draw_circle(graphics_engine &g, const T *p, double r, ge::MODE mode, unsigned num_v=20)
Draw a circle.
Definition: graphics_utility.h:56
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
Interface for handling drawing operations.
Definition: graphics_engine.h:38
static void draw_arrow(graphics_engine &g, const T *p0, const T *p1)
Draw an arrow.
Definition: graphics_utility.h:74