Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Real Problem in Listview dealing with tons of data Pin
xcal22-Aug-13 19:11
xcal22-Aug-13 19:11 
QuestionHow to initialize property page's dialog? SOLVED Pin
Vaclav_21-Aug-13 4:15
Vaclav_21-Aug-13 4:15 
AnswerRe: How to initialize property page's dialog? Pin
Freak3022-Aug-13 3:35
Freak3022-Aug-13 3:35 
GeneralRe: How to initialize property page's dialog? Pin
Vaclav_22-Aug-13 5:26
Vaclav_22-Aug-13 5:26 
GeneralRe: How to initialize property page's dialog? Pin
Vaclav_22-Aug-13 6:52
Vaclav_22-Aug-13 6:52 
GeneralRe: How to initialize property page's dialog? Pin
Vaclav_24-Aug-13 5:08
Vaclav_24-Aug-13 5:08 
QuestionHow to make the camera rotate with the player? Pin
LittleJackFlash21-Aug-13 3:19
LittleJackFlash21-Aug-13 3:19 
AnswerRe: How to make the camera rotate with the player? Pin
pasztorpisti21-Aug-13 4:05
pasztorpisti21-Aug-13 4:05 
By keeping the position/rotation of your camera tied to that of your player with fixed delta rotation/movement maybe with some attenuation on some of the components of the world position of the camera if the movement of the player is ugly. Its a different story how to use this camera position/rotation in the renderer but that should be trivial if you have some basic knowledge in the area. You have just grabbed out an opengl call from somewhere, noone will be able to tell what is wrong in your code but it can be anything based on the kind of this question. Considering that you are mixing the update of your object positions with renderer code your software design isn't good for sure.

Your game code should look like the following:
- a set/graph of object that describe the state of your game at any given time. This can be for example a set of world object with position/rotation values and attributes like "dead", "visible".
- an infinite loop that does the following:
* updates the state of your game objects (for example by stepping their position/rotation using physics simulation, you have to update the state of dependent objects (like your camera) only after its dependency objects (player) are updated.
* OPTIONALLY render the state of your game (the world objects/entities with their position and other state variables) and draw the "hud"/score and other info on the screen as the result of rendering the state of your "game rules" object. Here you setup your renderer camera based on the world position/rotation of your camera object in your game state data that has already been updated based on its dependency object: the player object.


Note that your game should work even without calling the global "render" function in your game, the game should work without a renderer just by printing out the state of your objects to the console at any time if your game code design is good!

So what is the problem?

modified 21-Aug-13 16:03pm.

GeneralRe: How to make the camera rotate with the player? Pin
LittleJackFlash21-Aug-13 22:00
LittleJackFlash21-Aug-13 22:00 
GeneralRe: How to make the camera rotate with the player? Pin
Jonathan Davies21-Aug-13 22:38
Jonathan Davies21-Aug-13 22:38 
GeneralRe: How to make the camera rotate with the player? Pin
LittleJackFlash21-Aug-13 23:25
LittleJackFlash21-Aug-13 23:25 
GeneralRe: How to make the camera rotate with the player? Pin
Jonathan Davies21-Aug-13 23:46
Jonathan Davies21-Aug-13 23:46 
GeneralHow to write Benford’s Law in C++ Need Help Pin
Member 1022170020-Aug-13 16:55
Member 1022170020-Aug-13 16:55 
QuestionRe: How to write Benford’s Law in C++ Need Help Pin
Richard MacCutchan20-Aug-13 20:10
mveRichard MacCutchan20-Aug-13 20:10 
GeneralRe: How to write Benford’s Law in C++ Need Help Pin
BadKarma20-Aug-13 21:30
BadKarma20-Aug-13 21:30 
SuggestionRe: How to write Benford’s Law in C++ Need Help Pin
David Crow21-Aug-13 6:26
David Crow21-Aug-13 6:26 
QuestionCTabCtrl header colour anomaly in CPaneDialog Pin
D G McKay20-Aug-13 2:07
D G McKay20-Aug-13 2:07 
AnswerRe: CTabCtrl header colour anomaly in CPaneDialog Pin
D G McKay2-Sep-13 0:14
D G McKay2-Sep-13 0:14 
QuestionWindow Position Pin
john563218-Aug-13 19:44
john563218-Aug-13 19:44 
AnswerRe: Window Position Pin
Richard MacCutchan18-Aug-13 20:56
mveRichard MacCutchan18-Aug-13 20:56 
GeneralRe: Window Position Pin
john563219-Aug-13 4:11
john563219-Aug-13 4:11 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 5:06
mveRichard MacCutchan19-Aug-13 5:06 
GeneralRe: Window Position Pin
pasztorpisti19-Aug-13 6:09
pasztorpisti19-Aug-13 6:09 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 20:33
mveRichard MacCutchan19-Aug-13 20:33 
GeneralRe: Window Position Pin
pasztorpisti20-Aug-13 2:03
pasztorpisti20-Aug-13 2:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.