• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

VCAlfox

Members
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

148 Neutral

About VCAlfox

  • Rank
    Member
  1. Thanks a lot for all the answers guys, tomorrow I'l try to do all
  2. Hi guys, I have this problem: I have a point as vector3 (x,y,z) in 3d space, and its direction (vector3 x,y,z). In the scene there are also many triangles eachone with 3 vertex (each vertex as a vector3)   this point moves along its direction, how can I know: 1. what triagle is hitted (I have many of them) 2. where exactly is hitted, as x,y,z coordinates   I'm using c++ for my project.   Thanks
  3. hi I tried with xvfb, first of all I installed it sudo apt-get install xvfb than lauched with command xvfb-run ./RayTracing But I receive an error: Ray.cpp Error: Failed to open GLFW window. This is the output that I write when glfwCreateWindow() fails window = glfwCreateWindow( WINDOW_WIDTH, WINDOW_HEIGHT, "Ray Tracing - Alfonso Oricchio", NULL, NULL); // Open a window and create its OpenGL context if( window == NULL ){ fprintf( stderr, "Ray.cpp Error: Failed to open GLFW window.\n" ); glfwTerminate(); return -1; } So maybe, I have to set up better xvfb-run? with what params?
  4. oh really thanks I'll try as soon as possible
  5. Hi followed Kaptein instruction This is the modified Makefile variables MYINC=-I/isis/AlfonsoOricchio/RayTracing/src/glfw/include/ -I/isis/AlfonsoOricchio/RayTracing/src/glew/include -I/isis/AlfonsoOricchio/RayTracing/src MYCUDAINC=-I/usr/local/cuda-5.5/include/ MYLIB=-L/usr/local/cuda-5.5/lib64/ MYCMD=$(shell pkg-config glfw3 --libs --static glew) -lcudart NVCC=/usr/local/cuda-5.5/bin/nvcc all: myexe myexe: render.o controls.o objloader.o shader.o Ray.o g++ render.o controls.o objloader.o shader.o Ray.o $(MYLIB) $(MYCMD) -o RayTracing Ray.o: Ray.cpp g++ -c $(MYINC) $(MYCUDAINC) Ray.cpp controls.o: controls.cpp g++ -c $(MYINC) controls.cpp objloader.o: objloader.cpp g++ -c $(MYINC) objloader.cpp shader.o: shader.cpp g++ -c $(MYINC) shader.cpp render.o: $(NVCC) -c -arch=sm_20 render.cu clean: rm -rf *o RayTracing Now compiling without errors.  And this is my output for statit linking g++ render.o controls.o objloader.o shader.o Ray.o -L/usr/local/cuda-5.5/lib64/ -L/usr/local/lib -lglfw3 -lrt -lXrandr -lXi -lXxf86vm -lXrender -lXfixes -lGLEW -lGLU -lGL -lm -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp -lcudart -o RayTracing Thanks a lot guys.   I have a different problem now, when I launch the program I have this output: X Error of failed request: BadRRCrtc (invalid Crtc parameter) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 22 (RRGetCrtcGammaSize) Crtc id in failed request: 0x1a98e00 Serial number of failed request: 62 Current serial number in output stream: 62 I believe because the linux server has no monitor so Xrandr fails.   but I think I have to open another post for that. Because this is a different problem, right?
  6. thanks for reply I thought about that, and serching what lib I have to install, I tried to download this sudo apt-get install libglfw3-dev but I receive this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libglfw3-dev
  7. Hi Bregma, I tried as you suggest. But MYCMD=$(shell pkg-config --libs libglfw glew) give me this errors: g++ render.o controls.o objloader.o shader.o Ray.o -L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ -lcudart -lglfw -lGLEW -lGLU -lGL -o RayTracing controls.o:controls.cpp:function computeMatricesFromInputs(): error: undefined reference to 'glfwGetCursorPos' controls.o:controls.cpp:function computeMatricesFromInputs(): error: undefined reference to 'glfwSetCursorPos' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwWindowHint' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwCreateWindow' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwMakeContextCurrent' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwSetInputMode' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwSetCursorPos' Ray.o:Ray.cpp:function main: error: undefined reference to 'glfwWindowShouldClose' collect2: ld returned 1 exit status
  8. UPDATE2: I solved my problem. the last library to link is -lrt, so the line in my Makefile is now this MYCMD=-lcudart -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lrt -lGLEW -lGL I hope this thread can help someone :)
  9. UPDATE: In my Makefile I modify this line as follow MYCMD=-lcudart -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lGLEW -lGL now the errors are only 2: /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function getRawTime: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function _glfwInitTimer: error: undefined reference to 'clock_gettime' Maybe I need to link another library, but I don't find anything about that
  10. Hello! I receive a lot of errors when I try to compile my c++ program. I am  on a Ubuntu 12.04 machine, this machine is a server that I control. In order I had: downloaded the source code of GLFW from official site, then followed the instruction cd <glfw-root-dir> mkdir build cd build cmake .. after this in the "build" folder I launched the command make in the folder build/src I found the libglfw3.a and in the glfw folder root the /include folder. I copied all the glfw folder into my project src/ folder,  and also copied libglfw3.a in src/lib folder. In this folder I had also libGLEW.a used to my project too.   I created this Makefile for my project: #variables MYINC=-I/isis/AlfonsoOricchio/RayTracing/src/glfw/include -I/isis/AlfonsoOricchio/RayTracing/src/glew/include -I/isis/AlfonsoOricchio/RayTracing/src MYCUDAINC=-I/usr/local/cuda-5.5/include/ MYLIB=-L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ MYCMD=-lcudart -lglfw3 -lGLEW -lGL NVCC=/usr/local/cuda-5.5/bin/nvcc all: myexe myexe: render.o controls.o objloader.o shader.o Ray.o g++ render.o controls.o objloader.o shader.o Ray.o $(MYLIB) $(MYCMD) -o RayTracing Ray.o: Ray.cpp g++ -c $(MYINC) $(MYCUDAINC) Ray.cpp controls.o: controls.cpp g++ -c $(MYINC) controls.cpp objloader.o: objloader.cpp g++ -c $(MYINC) objloader.cpp shader.o: shader.cpp g++ -c $(MYINC) shader.cpp render.o: $(NVCC) -c -arch=sm_20 render.cu clean: rm -rf *o RayTracing But when I run the make, the "myexe" call give me this errors: g++ render.o controls.o objloader.o shader.o Ray.o -L/isis/AlfonsoOricchio/RayTracing/src/lib -L/usr/local/cuda-5.5/lib64/ -lcudart -lglfw3 -lGLEW -lGL -o RayTracing /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRGetCrtcGammaSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwInitGammaRamp: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRGetCrtcGammaSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRGetCrtcGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XRRFreeGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XF86VidModeGetGammaRampSize' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformGetGammaRamp: error: undefined reference to 'XF86VidModeGetGammaRamp' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRAllocGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRSetCrtcGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XRRFreeGamma' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_gamma.c.o):x11_gamma.c:function _glfwPlatformSetGammaRamp: error: undefined reference to 'XF86VidModeSetGammaRamp' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function translateKey: error: undefined reference to 'XkbKeycodeToKeysym' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function translateKey: error: undefined reference to 'XkbKeycodeToKeysym' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function updateKeyCodeLUT: error: undefined reference to 'XkbGetKeyboard' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function updateKeyCodeLUT: error: undefined reference to 'XkbFreeKeyboard' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function getSupportedAtom: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function detectEWMH: error: undefined reference to 'XFree' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XInternAtom' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XF86VidModeQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XRRQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XRRQueryVersion' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XIQueryVersion' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XkbQueryExtension' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function initExtensions: error: undefined reference to 'XkbSetDetectableAutoRepeat' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreatePixmap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreateGC' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFillRectangle' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XCreatePixmapCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFreePixmap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function createNULLCursor: error: undefined reference to 'XFreeGC' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function terminateDisplay: error: undefined reference to 'XCloseDisplay' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwGrabXErrorHandler: error: undefined reference to 'XSetErrorHandler' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwReleaseXErrorHandler: error: undefined reference to 'XSync' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwReleaseXErrorHandler: error: undefined reference to 'XSetErrorHandler' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwInputXError: error: undefined reference to 'XGetErrorText' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XInitThreads' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XOpenDisplay' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformInit: error: undefined reference to 'XrmUniqueQuark' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_init.c.o):x11_init.c:function _glfwPlatformTerminate: error: undefined reference to 'XFreeCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRSetCrtcConfig' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwSetVideoMode: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRSetCrtcConfig' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwRestoreVideoMode: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetOutputPrimary' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitors: error: undefined reference to 'XRRFreeScreenResources' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetMonitorPos: error: undefined reference to 'XRRGetCrtcInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetVideoModes: error: undefined reference to 'XRRGetOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_monitor.c.o):x11_monitor.c:function _glfwPlatformGetVideoModes: error: undefined reference to 'XRRFreeOutputInfo' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function getRawTime: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_time.c.o):x11_time.c:function _glfwInitTimer: error: undefined reference to 'clock_gettime' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function translateChar: error: undefined reference to 'XLookupString' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XCreateColormap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XCreateWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSaveContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeWindowAttributes' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMProtocols' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocWMHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocSizeHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetWMNormalHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XAllocClassHint' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XSetClassHint' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XISelectEvents' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function createWindow: error: undefined reference to 'XRRSelectInput' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function hideCursor: error: undefined reference to 'XUngrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function hideCursor: error: undefined reference to 'XDefineCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function captureCursor: error: undefined reference to 'XGrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function showCursor: error: undefined reference to 'XUngrabPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function showCursor: error: undefined reference to 'XUndefineCursor' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XGetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XRaiseWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XSetInputFocus' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XMoveWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function enterFullscreenMode: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XSetScreenSaver' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XChangeProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function leaveFullscreenMode: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XSendEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XGetEventData' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XFreeEventData' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function processEvent: error: undefined reference to 'XRRUpdateConfiguration' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwFindWindowByHandle: error: undefined reference to 'XFindContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwGetWindowProperty: error: undefined reference to 'XGetWindowProperty' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XDeleteContext' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XUnmapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XDestroyWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformDestroyWindow: error: undefined reference to 'XFreeColormap' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowTitle: error: undefined reference to 'Xutf8SetWMProperties' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowPos: error: undefined reference to 'XTranslateCoordinates' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowPos: error: undefined reference to 'XTranslateCoordinates' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowPos: error: undefined reference to 'XMoveWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowPos: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformGetWindowSize: error: undefined reference to 'XGetWindowAttributes' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XAllocSizeHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XSetWMNormalHints' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XResizeWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetWindowSize: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformIconifyWindow: error: undefined reference to 'XIconifyWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformRestoreWindow: error: undefined reference to 'XMapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformShowWindow: error: undefined reference to 'XMapRaised' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformShowWindow: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformHideWindow: error: undefined reference to 'XUnmapWindow' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformHideWindow: error: undefined reference to 'XFlush' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformPollEvents: error: undefined reference to 'XPending' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformPollEvents: error: undefined reference to 'XNextEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformWaitEvents: error: undefined reference to 'XPending' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_window.c.o):x11_window.c:function _glfwPlatformSetCursorPos: error: undefined reference to 'XWarpPointer' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwInitContextAPI: error: undefined reference to 'pthread_key_create' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwTerminateContextAPI: error: undefined reference to 'pthread_key_delete' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwPlatformMakeContextCurrent: error: undefined reference to 'pthread_setspecific' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(glx_context.c.o):glx_context.c:function _glfwPlatformGetCurrentContext: error: undefined reference to 'pthread_getspecific' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPushSelectionToManager: error: undefined reference to 'XConvertSelection' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPushSelectionToManager: error: undefined reference to 'XCheckIfEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformSetClipboardString: error: undefined reference to 'XSetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformSetClipboardString: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XGetSelectionOwner' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XConvertSelection' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XCheckTypedEvent' /isis/AlfonsoOricchio/RayTracing/src/lib/libglfw3.a(x11_clipboard.c.o):x11_clipboard.c:function _glfwPlatformGetClipboardString: error: undefined reference to 'XDeleteProperty' collect2: ld returned 1 exit status What Can I do?
  11. Hello KulSeran, thanks for reply I changed my code as you suggest: glm::vec3 cd = glm::vec3(0.0,0.0,1.0);//CamGetDirection(); glm::vec3 cp = glm::vec3(0.0,0.0,0.0);//CamGetPosition(); glm::vec4 viewport = glm::vec4(0.0f, 0.0f, WINDOW_WIDTH, WINDOW_HEIGHT); glm::mat4 tmpView = glm::mat4(1.0f);//getViewMatrix(); glm::mat4 tmpProj = glm::mat4(1.0f);//getProjectionMatrix(); glm::vec3 screenPosS = glm::vec3(0.0,0.0,0.0); glm::vec3 screenPosE = glm::vec3((float)WINDOW_WIDTH, (float)WINDOW_HEIGHT,0.0); glm::vec3 screenPosM = glm::vec3((float)WINDOW_WIDTH/2, (float)WINDOW_HEIGHT/2,0.0); glm::vec3 wpS = glm::unProject(screenPosS, tmpView, tmpProj, viewport); glm::vec3 wpE = glm::unProject(screenPosE, tmpView, tmpProj, viewport); glm::vec3 wpM = glm::unProject(screenPosM, tmpView, tmpProj, viewport); printf_s("CDir: %f %f %f\n",cd.x,cd.y,cd.z); printf_s("CPos: %f %f %f\n",cp.x,cp.y,cp.z); printf_s("WPStart: %f %f %f\n",wpS.x,wpS.y,wpS.z); printf_s("WPEnd: %f %f %f\n",wpE.x,wpE.y,wpE.z); printf_s("WMid: %f %f %f\n",wpM.x,wpM.y,wpM.z); I also added the middle screen position glm::vec3 screenPosM = glm::vec3((float)WINDOW_WIDTH/2, (float)WINDOW_HEIGHT/2,0.0); and the output is:   [attachment=23534:out.jpg]   so I think it works. Just a doubt on the Z axis...is normal it's -1?
  12. Hello, this is my problem. I have a camera with an origin point (Vector3 with x, y, z) and its vector3 direction , and a screen width and height. I want to transform each pixel of the screen view in a vector3 in 3d space. I found this code on internet, and adapted to my project: glm::vec3 cd = CamGetDirection(); glm::vec3 cp = CamGetPosition(); glm::vec4 viewport = glm::vec4(0.0f, 0.0f, WINDOW_WIDTH, WINDOW_HEIGHT); glm::mat4 tmpView = getViewMatrix(); glm::mat4 tmpProj = getProjectionMatrix(); glm::vec3 screenPosS = glm::vec3(0.0,0.0,0.0); glm::vec3 screenPosE = glm::vec3((float)WINDOW_WIDTH, (float)WINDOW_HEIGHT,0.0); glm::vec3 wpS = glm::unProject(screenPosS, tmpView, tmpProj, viewport); glm::vec3 wpE = glm::unProject(screenPosE, tmpView, tmpProj, viewport); CamGetDirection() give me the vec3 direction of the camera CamGetPosition() of course give me the vec3 position of the camera getViewMatrix() give me the view matrix and this is the code: ViewMatrix = glm::lookAt( position, // Camera is here position+direction, // and looks here : at the same position, plus "direction" up // Head is up (set to 0,-1,0 to look upside-down) ); getProjectionMatrix() is this: ProjectionMatrix = glm::perspective(FoV /* FoV is 45.0f degree */, 4.0f / 3.0f, 0.1f, 100.0f); glm::vec3 screenPosS and glm::vec3 screenPosE are two vec3 of the first pixel and last pixel of the screen view   WINDOW_WIDTH and WINDOW_HEIGHT are my screen project setting in this case 1024 and 768   It seems working but I'm not sure on the numbers, I printed this: printf_s("CDir: %f %f %f\n",cd.x,cd.y,cd.z); printf_s("CPos: %f %f %f\n",cp.x,cp.y,cp.z); printf_s("WPStart: %f %f %f\n",wpS.x,wpS.y,wpS.z); printf_s("WPEnd: %f %f %f\n",wpE.x,wpE.y,wpE.z); and the output is: [attachment=23532:out.jpg]   Can you confirm if this code works?   Thanks
  13. Hello! I modified my program, as you suggest as follow. #define GLEW_STATIC #include <iostream> #include <stdio.h> #include <stdlib.h> #include <GL/glew.h> #include <GLFW/glfw3.h> #include "TryClass.h" using namespace std; int main() { if( !glfwInit() ) { cout << "fail init glfw" << endl; return -1; } GLFWwindow* window = glfwCreateWindow( 1024, 768, "Window", NULL, NULL); if( window == NULL ){ cout << "failed to open window" << endl; glfwTerminate(); return -1; } glfwMakeContextCurrent(window); if (glewInit() != GLEW_OK) { cout << "fail init glew" << endl; return -1; } glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE); do{ // Swap buffers glfwSwapBuffers(window); glfwPollEvents(); } while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && glfwWindowShouldClose(window) == 0 ); glfwDestroyWindow(window); glfwTerminate(); return 0; } And add -DGLEW_STATIC in commandline g++ -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glfw\include -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glew\include TryClass.cpp ProvaGLFW.cpp -LC:\Users\Alfonso-PC\workspace\ProvaGLFW\lib -static -lglfw3 -lgdi32 -lglew32s -lopengl32 -DGLEW_STATIC Now I have a "nice" well-functioning black window   Thanks a lot! now I'll search how to make a "make file" Again Thanks
  14. Hello! Really thanks for you availability, I downloaded your .a and I put it in the /lib folder. Now the error is changed. C:\Users\ALFONS~1\AppData\Local\Temp\ccXaI1XL.o:ProvaGLFW.cpp:(.text+0x17): unde fined reference to `glfwInit' C:\Users\ALFONS~1\AppData\Local\Temp\ccXaI1XL.o:ProvaGLFW.cpp:(.text+0x51): unde fined reference to `_imp__glewInit@0' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\A LFONS~1\AppData\Local\Temp\ccXaI1XL.o: bad reloc address 0x0 in section `.ctors' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link  failed: Invalid operation collect2.exe: error: ld returned 1 exit status this is my little main: #include <iostream> #include <GL/glew.h> #include <GLFW/glfw3.h> using namespace std; int main() { if( !glfwInit() ) { cout << "fail init glfw" << endl; // prints Hello World!!! return -1; } if (glewInit() != GLEW_OK) { cout << "fail init glew" << endl; // prints Hello World!!! return -1; } cout << "Hello World!!!" << endl; // prints Hello World!!! return 0; } ===========EDIT============== My bad, I forgot the: #define GLEW_STATIC And I changed the compile command as follow g++ -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glfw\include -IC:\Users\Alfonso-PC\workspace\ProvaGLFW\glew\include ProvaGLFW.cpp -LC:\Users\Alfonso-PC\workspace\ProvaGLFW\lib -static -lglfw3 -lgdi32 -lglew32s -lopengl32 Now it compiles: but give me a Warning: corrupt .drectve at end of def file and when I launch the a.exe the program (above) enter in the glewInit() "if" and always print