Рассылка закрыта
При закрытии подписчики были переданы в рассылку "Программирование в Delphi" на которую и рекомендуем вам подписаться.
Вы можете найти рассылки сходной тематики в Каталоге рассылок.
СообЧА. Программирование на Delphi
Информационный Канал Subscribe.Ru |
===СообЧа: Программирование на дельфи для чайников
и не только===
|
|
Автор рассылки: Pixel
. Наш веб-сайт pixelsoft.narod.ru |
Обзор литературы |
Ведущий рассылки, также предоставляет
следующие услуги: |
К заголовку | |
А теперь снова наш рекламный пунктик... ой, всмысле обзор. На сей раз хотел бы представить вам тот список лит-ры, который необходимо
прочесть для овладевания БАЗОВЫМИ навыками по дельфи: |
К заголовку | |
К вашему вниманию уникальный код! С помощью него и карты высот каринки( вы знаете что такое карта высот?) можно создать супер эффект на простом Canvas(к сожалению мой код моргает при перерисовке, но вы уж поковыряйтесь....) unit Unit1; interface uses type type normal = record type rgb32 = record type scanline = array[0..254] of rgb32; var implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); FOR y := -128 TO 127 do nx := pi / 2; end; procedure TForm1.Image1MouseMove(Sender:
TObject; Shift: TShiftState; X, procedure TForm1.Timer1Timer(Sender: TObject); end; procedure TForm1.ScrollBarChange(Sender:
TObject); dRed.Text := inttostr(scrollbar5.position); aRed.Text := inttostr(scrollbar8.position); nx := pi / 2; end; procedure TForm1.Label11Click(Sender: TObject);
|
К заголовку | |
Данный код работает правильно
только, если в пректе 0 форм , а сам код введен в DPR файл! uses const type TVector = Array[0..2] of glFloat; // Textures // User vaiables // Lights and Materials LmodelAmbient : Array[0..3] of glFloat = (0.2, 0.2, 0.2, 1.0); // And More Ambient Light
procedure glBindTexture(target: GLenum;
texture: GLuint); stdcall; external opengl32; {------------------------------------------------------------------}
glGenTextures(1, txtnumber); // Create
1 Texture result :=txtNumber;
vector[0] :=vector[0] / length;
// Calculate The Vector From Point 1 To
Point 0 ReduceToUnit(cross); // Normalize The
Vectors
glPushMatrix(); // Push The Modelview
Matrix glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
@MaterialColor); r :=1.5; // Radius glBegin(GL_QUADS); // Begin Drawing Quads x :=cos(u)*(2 + cos(v))*r; // Calculate
x Position (1st Point) vertexes[0][0] :=x; // Set x Value Of
First Vertex v :=(phi/180 * pi); // Calculate Angle
Of Second Point ( 0 ) x :=cos(u)*(2 + cos(v))*r; // Calculate
x Position (2nd Point) vertexes[1][0] :=x; // Set x Value Of
Second Vertex v :=(phi+20)/180*pi; // Calculate Angle
Of Third Point ( 20 ) x :=cos(u)*(2 + cos(v))*r; // Calculate
x Position (3rd Point) vertexes[2][0] :=x; // Set x Value Of
Third Vertex v :=(phi+20)/180*pi; // Calculate Angle
Of Fourth Point ( 20 ) x :=cos(u)*(2 + cos(v))*r; // Calculate
x Position (4th Point) vertexes[3][0] :=x; // Set x Value Of
Fourth Vertex calcNormal(vertexes, normal); // Calculate The Quad Normal glNormal3f(normal[0],normal[1],normal[2]); // Set The Normal // Render The Quad
// Copy Our ViewPort To The Blur Texture
(From 0,0 To 128,128... No Border)
glEnable(GL_TEXTURE_2D); // Enable 2D
Texture Mapping alphainc := alpha / times; // alphainc=0.2f / Times To Render Blur glBegin(GL_QUADS); // Begin Drawing Quads glTexCoord2f(0+spost,0+spost); // Texture
Coordinate ( 0, 0 ) glTexCoord2f(1-spost,0+spost); // Texture
Coordinate ( 1, 0 ) glTexCoord2f(1-spost,1-spost); // Texture
Coordinate ( 1, 1 ) spost := spost + inc; // Gradually Increase
spost (Zooming Closer To Texture Center) ViewPerspective(); // Switch To A Perspective View glEnable(GL_DEPTH_TEST); // Enable Depth
Testing {------------------------------------------------------------------} angle :=ElapsedTime / 5; // Update angle
Based On The Clock
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Realy Nice perspective calculations glEnable(GL_DEPTH_TEST); // Enable Depth
Buffer glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @LmodelAmbient); // Set The Ambient Light Model glLightModelfv(GL_LIGHT_MODEL_AMBIENT,
@GlobalAmbient); // Set The Global Ambient Light Model BlurTexture := EmptyTexture(); // Create
Our Empty Texture
glMatrixMode(GL_MODELVIEW); // Return
to the modelview matrix
// Makes current rendering context not
current, and releases the device // Attempts to delete the rendering context // Attemps to release the device context // Attempts to destroy the window // Attempts to unregister the window class
with wndClass do // Set up the window
class if (RegisterClass(wndClass) = 0) then
// Attemp to register the window class // Change to fullscreen if so desired // Try to change screen mode to fullscreen // If we are still in fullscreen then // Attempt to create the actual window // Try to get a device context // Settings for the OpenGL window // Attempts to find the pixel format supported
by a device context that is the best match to a given pixel format specification. // Sets the specified device context's
pixel format to the format specified by the PixelFormat. // Create a OpenGL rendering context // Makes the specified OpenGL rendering
context the calling thread's current rendering context // Initializes the timer used to calculate
the FPS // Settings to ensure that the window
is the topmost window // Ensure the OpenGL window is resized
properly Result := True;
// Perform application initialization: DemoStart := GetTickCount(); // Get Time when demo started // Main message loop: LastTime :=ElapsedTime; glDraw(); // Draw the scene if (keys[VK_ESCAPE]) then // If user pressed
ESC then set finised TRUE
|
http://subscribe.ru/
E-mail: ask@subscribe.ru |
Отписаться
Убрать рекламу |
В избранное | ||