Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 7th, 2005, 1:30 PM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Floats to doubles

I have a problem with floats and doubles.

I wanted to put a camera in my OpenGL scene. But when
I added the gluLookAt function, the program did'nt started
anymore.

I was using this code, and simply made a call like
_gluLookAt eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz
in my draw function.
These variables are created like this:
eyex dd 0.0

_gluLookAt macro A1, A2, A3, A4, A5, A6, A7, A8, A9
	push A9
	push A8
	push A7
	push A6
	push A5
	push A4
	push A3
	push A2
	push A1
	call gluLookAt
endm

I guessed that the problem was that the gluLookAt function expects 64 bits doubles,
instead of 32 bits floats. I tried my assumption by pushing twice as much on the stack.
Then the program started again, but with wrong values to gluLookAt of course.

How shall I solve this problem? How do I convert my floats to doubles? Is there
a simple way of doing this?

I am not an assembly guru, so try keeping the answears as clean as possible

Thanks

/Klarre
Klarre is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:40 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC