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 / Help with 3D shapes

Author
Message
SigurdVolsung
14
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 15th Nov 2009 01:45
Hi there everyone! I'm new to Dark GDK and to this site, so I've come here looking for help. Not sure this is the right board to put this on, but I'm sure someone will tell me if I should delete it.

Anyhow, I've been trying to make a Tic-Tac-Toe game for my computer class in college. I've completed it in 2D, but I wanted to put in a 3D sphere and cross-shaped object for better visuals, but I'm unsure of how to go about it. Could anyone give me any advice? Thanks in advance!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 15th Nov 2009 15:19 Edited at: 15th Nov 2009 15:45
Sphere: dbMakeObjectSphere.

Cross: dbMakeObjectBox and then position/rotate two long boxes to form a cross. (With a few more commands you can even join them together so that the boxes are limbs of the same object.)

EDIT: What method does your application use to display the graphics? Instead of using proper 3D objects and trying to mix those with 2D display, a simpler way is to make pictures in an image editor that look like 3D and then use those pictures as sprites.
SigurdVolsung
14
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 16th Nov 2009 18:15
Okay, that seems easy enough for me to do. Would I need any of the functions such as the Rate and Sync ones that appear in the example program for the 3D game?

Right now, I'm using the 2D game application, and Dark GDK just draws simple circles and crosses: nothing spectacular. I'm not good at making sprites or anything like that, but would that be easier?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th Nov 2009 22:40
The sync rate command in the beginning is advisable, although the default value is the same 60 that appears in the example. dbSyncOn tells the system you want to determine when to refresh the display (with dbSync) instead of automatic refresh, so that's a good thing too.

If you create 3D objects, then you need to position them in the 3D coordinate system, and also position the camera to show the view. If you place the objects along one plane, then the coordinates are reduced to the 2D system. For example, Z is always zero so you only set X,Y for the crosses and spheres, and position the camera to look along the Z axis.

With sprites, the position setting is easier because it remains 2D, and you don't need to bother with camera either. The sprite positions are determined in pixels, while in 3D it's world coordinates.

Login to post a reply

Server time is: 2024-10-01 18:32:10
Your offset time is: 2024-10-01 18:32:10