Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / I can't see my cube D=

Author
Message
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 11th Sep 2010 02:38


When I run it I only see green, and not my cube, anybody know why?

I want coke, not Pepsi!
Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 11th Sep 2010 06:21 Edited at: 11th Sep 2010 06:22
possibly because your not facing it.

try

dbControlCameraUsingArrowKeys(); (forgot the exact syntax but i think its 1,1,1).

btw, why do u have two cameras on the scene? (cameras take up alot of cpu)
you dont need dbMakeCamera(1);, you already have camera 0 by default, just use that.

Smoke me a kipper, ill be back for breakfast.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 11th Sep 2010 06:37
I don't really get that... is there a way I could do something like this in GDK?
x=object position x(1)
y=object position y(1)
z=object position z(1)
point camera (1,x,y,z)

I want coke, not Pepsi!
Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 11th Sep 2010 10:23 Edited at: 11th Sep 2010 10:50
well yes...
dbObjectPositionX()
dbPointCamera

and PLEASE tell me why you are using 2 cameras, it is really bad unless you need it, it is extra processing.
Use camera 0, it is already there.

for more of the commands goto:
Installdir\Dark GDK\Documentation
for me its
C:\Program Files\The Game Creators\Dark GDK\Documentation

put this in the loop:
void dbControlCameraUsingArrowKeys ( int iCamera, float fMove, float fTurn )
so
dbControlCameraUsingArrowKeys ( 0, 1, 1 )



remember, c++ is CaSe SenSitIvE

PS (it is better to program your own movement system, but dbcontrolcamera... is just easier to type up)

Smoke me a kipper, ill be back for breakfast.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 11th Sep 2010 17:01
if you downloaded DarkGDK 7.4, make sure to get the PATCH for it, scroll down, near the middle of the page, you'll find a new lib and core libraries update

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 11th Sep 2010 18:35 Edited at: 11th Sep 2010 18:40
Quote: "and PLEASE tell me why you are using 2 cameras, it is really bad unless you need it, it is extra processing.
Use camera 0, it is already there."

I find it easier to remember, sorry, and I really don't use more than 1 camera (or 2 with camera 0, but I don't use cam 0)

Quote: "if you downloaded DarkGDK 7.4, make sure to get the PATCH for it, scroll down, near the middle of the page, you'll find a new lib and core libraries update"

did that

Quote: "dbControlCameraUsingArrowKeys ( 0, 1, 1 )"

I tried that with camera 1 (1,1,1) and it didn't work, but i'll try your code right now.

Quote: "remember, c++ is CaSe SenSitIvE"

YeS i KnOw

EDIT: with

I cannot find the cube at all. Would you mind testing? Also I thought that when you make a camera its default rotation was forward so if we placed a cube infront of it we would be able to see it.

I want coke, not Pepsi!
Blobby 101
18
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 11th Sep 2010 19:04
Quote: "I really don't use more than 1 camera (or 2 with camera 0, but I don't use cam 0)"


Doesn't make a difference It's still there so it's still being rendered - even if you're not actually accessing the image, it's still using up a lot of memory that you cold easily save but just using camera 0.

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 11th Sep 2010 19:59
ok, I will do that next time, I still have this problem:
Quote: "I cannot find the cube at all. Would you mind testing? Also I thought that when you make a camera its default rotation was forward so if we placed a cube infront of it we would be able to see it."


I want coke, not Pepsi!
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 11th Sep 2010 21:46
Make sure you have the proper update for it.

http://forum.thegamecreators.com/?m=forum_view&t=172416&b=22 2nd post down by Bran Flakes.

I didn't even realize I had gotten the wrong patch as well untill I tried testing your code and nothing was showing up. Put the updated patch in and your code worked right away for me. I managed to get rid of the green screen by getting rid of the 2nd camera and just using the default camera 0. Hope this helps.
Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 12th Sep 2010 09:41
Yeah theres a bug where in 1 version the 3d stops rendering, tell us what happens if you download the newest update.

Smoke me a kipper, ill be back for breakfast.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 12th Sep 2010 11:16
New computer, need to install everything.

I want coke, not Pepsi!
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 12th Sep 2010 13:32 Edited at: 12th Sep 2010 13:36
First, don't use dbStr like this because you will create a huge memory leak. The whole point of using sprintf is that it does not need a number-to-string conversion because it will convert and format the number itself. This is the correct way of using sprintf:



The format string contains the position and format of the number. The %.2f means write out the floating point number with 2 decimal digits.

Second, do not try to delete[] your char array because it was not allocated with new. It is a statically allocated string. In fact I can't even run the program like this because it crashes right after startup. Remove that delete[] command. You can also move the char array declaration before the main loop since there is no need to re-allocate the string variable every loop.

After these modifications, the program runs fine and if you move the camera backwards, your cube will appear on the screen when the camera is at Z position -15 or so. If you switch autocam off, then you need to properly position the camera. If you include dbPositionCamera(0, 0, -15); before the main loop, then the cube will immediately be visible.


EDIT: I tested also the program that CocaCola posted in the very first post of this thread. For me, the rotating cube appears in front of the green background. It means that the program is OK, so you must have a problem with your Dark GDK installation.

I tested with Dark GDK 7.3 version.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 12th Sep 2010 21:09
Hey I got everything installed on my new computer and it works 100% thanks guys!

I want coke, not Pepsi!

Login to post a reply

Server time is: 2024-07-02 08:20:44
Your offset time is: 2024-07-02 08:20:44