Any reason not to use sprites instead?
You could make an animation of the bottles spinning or whatever if that's what you're after.
If you want something more elaborate, I wrote a simple demo of setting up an orthographic camera for you:
sync on
sync rate 60
autocam off
rem Create orthographic camera
camOrtho = 1
imgOrtho = 1
matOrthoProj = CreateOffCenterOrthoMatrixLH(0, screen width(), 0, screen height(), 1, 1024) ` 1 and 1024 are the distances to the near and far clipping planes; change as needed
make camera camOrtho
apply projection matrix4 matOrthoProj, camOrtho ` Requires Matrix1Utilities
color backdrop camOrtho, 0 ` This is necessary to make the backdrop completely transparent, so that we'll only render actual objects
set camera to image camOrtho, imgOrtho, screen width(), screen height(), 3, 21 ` D3DFMT_A8R8G8B8
delete matrix4 matOrthoProj
rem Create some spheres to be rotated and rendered by the orthographic camera
type sSphere
angle as float
obj as dword
endtype
dim sphere(8) as sSphere
for s = 0 to 7
sphere(s).angle = 45 * s
sphere(s).obj = find free object()
make object sphere sphere(s).obj, 10, 48, 48 ` The size in 3D units will correspond to pixel size with the projection matrix created above
set object mask sphere(s).obj, 2 ^ camOrtho ` Only render these objects to the orthographic ("2D") camera
color object sphere(s).obj, rgb(0, 31.875 * (s + 1), 0)
next s
rem Create some normal 3D geometry to be rendered by the main camera
floorObj = find free object()
make object plane floorObj, 1000, 1000, 1
xrotate object floorObj, 90
position object floorObj, 0, 0, 0
dim object(-1) as dword
for x = 0 to 100
for y = 0 to 100
if rnd(5) = 1
obj = find free object()
w# = 1 + (rnd(200) / 100.0)
h# = 1 + (rnd(200) / 100.0)
make object box obj, w#, h#, w#
position object obj, (x * 10) + (rnd(100) * 0.1) - 505, h# / 2.0, (y * 10) + (rnd(100) * 0.1) - 505
rem Ensure that these objects are only rendered to the main camera and not the orthographic one
set object mask obj, 1
array insert at bottom object()
object() = obj
endif
next y
next x
rem Position main camera
position camera 0, 20, -40
point camera 0, 0, 0
rem Main loop
while not escapekey()
rem Rotate spheres
for s = 0 to 7
sphere(s).angle = wrapvalue(sphere(s).angle + 1)
rem We ensure that the object is far enough along the Z axis to not be clipped by the near plane.
rem Render priority can be achieved by setting the Z coordinate lower for objects to appear in front of others.
rem The X and Y positions are in screen space.
position object sphere(s).obj, 148 + (128 * cos(sphere(s).angle)), screen height() - 148 + (128 * sin(sphere(s).angle)), 10.0
next s
rem Render the orthographic camera
sync mask 2 ^ camOrtho
fastsync
// Allow moving the main camera around. The orthographic camera will remain where it is, sampling the volume (0, screenWidth, 0, screenHeight, near, far)
mmx# = mouseMoveX() * 0.25
mmy# = mouseMoveY() * 0.25
mc = mouseClick()
rotate camera wrapvalue(camera angle x() + mmy#), wrapvalue(camera angle y() + mmx#), 0.0
move camera ((mc && 1) - (mc && 2)) * 1.5
if camera position y() < 1 then position camera camera position x(), 1, camera position z() ` Don't go below the ground level
if mc <> 0 then position mouse screen width() / 2, screen height() / 2 ` It's annoying when you accidentally drag the cursor outside the DBPro window...
rem Paste the image rendered by the orthographic camera as an image on top of whatever is drawn by camera 0
paste image imgOrtho, 0, 0, 1
rem Render the main camera
sync mask 1
sync
endwhile
end
rem Builds a off-center orthographic left handed projection matrix and returns its id
function CreateOffCenterOrthoMatrixLH(l as float, r as float, b as float, t as float, near as float, far as float)
mat = new matrix4(2 / (r - 1), 0, 0, 0, 0, 2 / (t - b), 0, 0, 0, 0, 1 / (far - near), 0, (l + r) / (l - r), (t + b) / (b - t), near / (near - far), 1)
endfunction mat
In summary it renders certain objects (masked to the ortho camera) with an orthographic projection to an image. This is then pasted on top of anything rendered by camera 0. By having the ortho matrix set to the size of the screen, this will let you position your "orthographic objects" in screen space rather than world space.
I believe this approach is exactly how DBPro renders 2D in the first place.
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)