PJ Campbell - 15 Jun 2009 - 19:35
We almost have the reflection but it is appearing on the other side of the surface. Here's our code...
//EDITING!!!
glPushMatrix();
glTranslatef(0, 0, 0);
drawSpheres();
glPopMatrix();
glEnable(GL_STENCIL_TEST); //Enable using the stencil buffer
glColorMask(0, 0, 0, 0); //Disable drawing colors to the screen
glDisable(GL_DEPTH_TEST); //Disable depth testing
glStencilFunc(GL_ALWAYS, 1, 1); //Make the stencil test always pass
//Make pixels in the stencil buffer be set to 1 when the stencil test passes
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
//Set all of the pixels covered by the floor to be 1 in the stencil buffer
drawPlatForm();
glColorMask(1, 1, 1, 1); //Enable drawing colors to the screen
glEnable(GL_DEPTH_TEST); //Enable depth testing
//Make the stencil test pass only when the pixel is 1 in the stencil buffer
glStencilFunc(GL_EQUAL, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); //Make the stencil buffer not change
//Draw the cube, reflected vertically, at all pixels where the stencil
//buffer is 1
glPushMatrix();
glScalef(1, -1, 1);
glTranslatef(0, 29, 0);
drawSpheres();
glPopMatrix();
glDisable(GL_STENCIL_TEST); //Disable using the stencil buffer
//Blend the floor onto the screen
glEnable(GL_BLEND);
glColor4f(1, 1, 1, 0.7f);
drawPlatForm();
glDisable(GL_BLEND);
//EDITING!!!
John,
It looks like you have created a visual studio project yourself rather than using the template. To have your code working, you will have to make the compiler aware that it should use corona library files. To do this, follow this procedure:
In visual studio, go to - Project ->
properties. A pop-up window will open up. In this window, click on:
Configuration Properties -> Linker -> Input. Under additional dependencies, type in: 'lib\win32\corona.lib glut32.lib' (without the quotes. Then click Apply and hit OK. Your code should now compile and shouldn't complain anymore.
A non-geeky reply to your question is that your code 'LoadTexture.cpp' has all the required function definitions from 'LoadTexture.h' but it does not know anywhereabouts of where those function definitions are implemented. When you tell visual studio where it can find it, visual studio becomes very happy, which means you will be happy
Hope this works,
Vijay.
PJ Campbell - 11 Jun 2009 - 16:49
Vijay, my program is working except I can't cut my image file!
Please help
JohnNewman - 11 Jun 2009 - 14:41
Hi Vijay, I am working on the project now and what our group is doing is we are recreating the first level of Super Mario Bros in 3-D and we're doing that by changing the code that we used for Wednesday's assignment. However, I need to add texture to objects in this project so I copied all of the .cpp and .h files that were included in the texture mapping code that we modified today. However, when I try to compile to program I get the following errors
Error 5 error LNK2019: unresolved external symbol _CorConvertImage@8 referenced in function "class corona::Image * __cdecl corona::OpenImage(char const *,enum corona::PixelFormat,enum corona::FileFormat)" (?OpenImage@corona@@YAPAVImage@1@PBDW4PixelFormat@1@W4FileFormat@1@@Z) loadTexture.obj World1-1
Error 6 error LNK2019: unresolved external symbol _CorOpenImage@8 referenced in function "class corona::Image * __cdecl corona::OpenImage(char const *,enum corona::PixelFormat,enum corona::FileFormat)" (?OpenImage@corona@@YAPAVImage@1@PBDW4PixelFormat@1@W4FileFormat@1@@Z) loadTexture.obj World1-1
Error 7 error LNK2019: unresolved external symbol _CorFlipImage@8 referenced in function "class corona::Image * __cdecl corona::FlipImage(class corona::Image *,int)" (?FlipImage@corona@@YAPAVImage@1@PAV21@H@Z) loadTexture.obj World1-1
Error 8 fatal error LNK1120: 3 unresolved externals X:\jnewman\OPENGL\Debug\World1-1.exe World1-1
In trying to solve the problem I removed loadTexture.cpp from the project and it did compile, but without that file I won't be able to add texture. Can you help?
Mina, Turn in your homework on the X drive (X:\users\reu\GraphicsProgrammingCourse\submissions\Day1). This is for Day 1. There are folders for each day of submissions. If you are unable to access this drive from a home computer, just put the folder on to a flash drive and copy the files over tomorrow before class.
MinaChoi - 08 Jun 2009 - 18:34
Hello Vijay~
Where do we turn in the homework? Is there a submission page? or should we just e-mail you the zipped file?
Hello everyone, I would like everyone to actively participate in this forum and voice their questions and concerns. I will monitor this thread and reply as soon as I can.
-- -- VijayKalivarapu - 28 May 2009