Stop Microsoft

Miscellaneous => Programming & Networking => Topic started by: eXor on 7 September 2002, 02:32

Title: Question for C/C++ gurus..
Post by: eXor on 7 September 2002, 02:32
I'm proficient at Pascal but new to C / C++  so I thought I'd make a simple terrain engine to teach myself.  I downloaded this tutorial ( http://www.gametutorials.com/download/OpenGL/HeightMap_OGL.zip (http://www.gametutorials.com/download/OpenGL/HeightMap_OGL.zip) ) and it looks great.  However it keeps crashing consistently if I go left past a certain point or backwards past a certain point.  I'm guessing this is caused by the value of a "positive only" variable getting decremented to a point where it goes below zero.  I peeked at the source code but almost all the variables are floating point type.  I'll pore over the code tomorrow in detail when I'm less tired  ( right now my head is swimming just looking at it hehe )

Any pointers ( pardon the pun ) would be appreciated.
Title: Question for C/C++ gurus..
Post by: choasforages on 7 September 2002, 06:32
ok, i don't really know, but im going to barf some stuff in your post, sorry

alright people, this is a good post, it has to do with programing, and not breaching computer security, or h4x0ring MSN

and know that i though of it, go thruogh the totorial, and change all the

float

to

a larger float var, i forget but its somthing like
double float or somthing, look it up

it should slow the exucution of the code up, and should let you go farther
Title: Question for C/C++ gurus..
Post by: LorKorub on 7 September 2002, 06:42
Try using a "long" float.  What might be happening is that you are getting too many places past the decimal point of normal float value when your function, or whatever you have, is executing.  Using "Long" will counter that problem.
Title: Question for C/C++ gurus..
Post by: eXor on 7 September 2002, 15:17
thanks for the tip, i'll have a go


btw i feel so dumb  posted the wrong link  it was http://www.gametutorials.com/download/OpenGL/HeightMap2_OGL.zip (http://www.gametutorials.com/download/OpenGL/HeightMap2_OGL.zip)
Title: Question for C/C++ gurus..
Post by: Kintaro on 7 September 2002, 20:05
Try having a beer  :D