OpenGL - Low FPS on simple 3d game [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am developping a 3d game, but already at one of the first tests, with really few calculations I get around 3 or 4 fps.
The following is my entire code: http://pastebin.com/j2DWPS6Z
This is the Terrain.cpp file I used in the main code: http://pastebin.com/d1gnE5KH
Looking to the code I use for drawing, I am drawing only 400 polygons. As far as I know that's not supposed to drop the fps to around 3 to 4 fps.
The computer I am using is HP Elitebook 8570w, with 8GB ram and an Intel core i7, so that's not the problem.
Does anyone know what I am doing wrong to cause the fps to be this low?

I think that the problem could be the call to glFlush() from the inner loop of drawTerrain(). You do not usually need to call this function, least of all from the inner loop. Try just removing it.

Related

how to track moving sphere path? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I'm working on a project in C++ and OpenGL on Visual Studio 2010 and I have some spheres moving around the screen. How can I track their movement and draw a line behind them while they move?
Store their positions in a vector over time and each frame you draw the points from the vector with GL_LINE_STRIP.
Checkout some OpenGL tutorial if you don't know how to draw the lines themselves.

OpenCV to detect movement [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
This may be a repost but I thought I might open a topic myself since nothing really answers my questions so far.
Okay, so if I attach a webcam to a robot, is it possible to use the webcam to determine which way the robot is moving (Forward, back, turning left, turning right) because I am doing a project that requires me to detect alignment of the robot down a hallway using a webcam.
Is this possible?
You can do this with optical flow. It is implemented in OpenCV

C++ code performance drop in iOS device [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have implemented some C++ code, and have run it on a Windows machine. The execution time takes around 220 milliseconds. I ran the same code on an iOS device (iPad), where it takes 1 second for the execution time.
What would be the reason? How can I achieve the same performance on an iOS device? Is there any way to increase the performance of C++ code on such a device?
What are the ways to increase the performance of a C++ code in iOS?
I suppose the average Windows machine will be a lot more powerful than an iPad for many tasks.
That said, use Instruments (part of Xcode) to profile the code and see where it's spending most of its time, maybe some optimisations for iPad will become clear.

EEG blink detection algorithm for neurosky mindwave? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
This might be a long shot but does anyone know how I can implement a blink detection algorithm using the eeg raw data? I've tried just detecting a spike in brain activity but it also gives a false positive whenever the electrode moves on my forehead.
eye blinks in EEG data aren't actual waves they are actually artifacts due to the potential difference between the cornea and the retina. According to wikipedia they are usually in the 4-7Hz or 8-13Hz.
They are detectable in the fp1 and fp2 , which are closest to the eyes.
Here is a useful paper about removing the artifact in question
you might also want to look into Independent Component Analysis (ICA) and Regression Analysis This is something thats going to take a lot of research from you.

Real-time pitch detection using FFT [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I'm trying to do real-time pitch detection using C++. I'm testing some code from performous (http://performous.org/), because everything else hasn't worked for me. I know for sure that this works, but i just cant get it to work. I've been trying this for a few weeks now, and I haven't been able to get any pitch detection code working.
Instead of using input from the mic, you should create data of a known single frequency and run that through the program and see if it gets you the correct result. Then you can add harmonics to it and see if that works. Real world data is just too variable for initial testing.
Performous audio code has some optimizations, frequency limits and heuristics that make it only suitable for singing (and other similar tones). The optimal range is around 80-600 Hz.
C/C++/Obj-C Real-time algorithm to ascertain Note (not Pitch) from Vocal Input
Check the accepted answer on this link.
I have scoured SO for an answer to this problem, and this is the most useful resource I have found.
It appears that Performous uses this algorithm, but it's hard to make out from the Performous code
EDIT: I have finally managed a working solution. e-mail me if interested sunfish|gmail|c0m