Author Topic: Question for C/C++ gurus..  (Read 1156 times)

eXor

  • Newbie
  • *
  • Posts: 18
  • Kudos: 0
    • http://x-men.arowa.com
Question for C/C++ gurus..
« 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 ) 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.

choasforages

  • VIP
  • Member
  • ***
  • Posts: 1,729
  • Kudos: 7
    • http://it died
Question for C/C++ gurus..
« Reply #1 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
x86: a hack on a hack of a hackway
alpha, hewlett packed it A-way
ppc: the fruity way
mips: the graphical way
sparc: the sunny way
4:20.....forget the DMCA for a while!!!

LorKorub

  • Member
  • **
  • Posts: 175
  • Kudos: 0
Question for C/C++ gurus..
« Reply #2 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.
"American English -- the noble language of your superiors"

eXor

  • Newbie
  • *
  • Posts: 18
  • Kudos: 0
    • http://x-men.arowa.com
Question for C/C++ gurus..
« Reply #3 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

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Question for C/C++ gurus..
« Reply #4 on: 7 September 2002, 20:05 »
Try having a beer  :D