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.

DarkBASIC Professional Discussion / Orthogonal Projections in DBP?

Author
Message
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 10th Oct 2011 21:36
Hi all!

I'm just curious: Is it possible to utilize an orthogonal projection in DBP?

The reason I ask is I noticed you can create LH ortho and RH ortho matrices in using the 3D maths commands.
ZestyPro
14
Years of Service
User Offline
Joined: 27th Aug 2011
Location: The Grid
Posted: 11th Oct 2011 01:52 Edited at: 11th Oct 2011 01:53
ummm..............................................................
sorry i cant help. good luck though!





i like cheese pizza. do you like cheese pizza?
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 11th Oct 2011 03:17 Edited at: 11th Oct 2011 03:19
Quote: "I'm just curious: Is it possible to utilize an orthogonal projection in DBP?"

of cource it is,, search for cloggy's 3d func plugin, there's a command that turns persepctive camera into ortho projection camera

Or, you can use this function:


Width# and height# are dimensions of the window where camera will be rendered

DBProCameraDebug holds a id of a loaded DBProCameraDebug plugin, you'll have to declare that as global and load that dll before you can use this function

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 11th Oct 2011 03:43
have a look at vector3 and matrix4 commands.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 11th Oct 2011 04:53
Thanks Brendy boy!

Also Basjak, that's what I was looking at in the command set, but I didn't see any commands to apply the ortho matrix to the camera.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 11th Oct 2011 06:57
@Brendy boy: can you provide a link of that. thanks
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 11th Oct 2011 08:36
I've spent many hours investigating orthogonal and isometric views. My advice would be to forget plugins, forget user functions, and simply stick with the following trick. Paste my code into blank new project;



Now most of my code is just myself testing some non-related image creation commands from camera scenes, but of interest, I toggled the built in DBpro camera variables to give an effect of orthographic views.

The key to my code and of interest to yourself is in these three commands;

position camera 1,0,4000,-4000
Set Camera range 1, 3000, 5000
Set Camera fov 1, 2

My variables are just testing, but by tweaking a large camera distance and a small field of view, you'll bring an orthographic effect which is hopefully suitable for your game. Further to this, adjust the camera range so objects stay selectable when using the pick object command. Pick object will not work if you do not configure the camera range, or if you configure it incorrectly.

Regarding my actual testing demo, I no longer use the "Paste Image" command, but rather I use alpha camera view ports, which allows objects to be clicked with ease in multiple view ports, with multiple camera angles and distances. This is not possible with the paste image technique.

Again, I come to this conclusion after spending roughly a month investigating orthographic threads, DLL's and discussions. Please let me know your findings, as I'm always looking for better/simpler ways to do what we do.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 11th Oct 2011 15:21
@burning feet man: you can use in the future the command:
Quote: "texture backdrop imageno"


@DA_ryhno: more matrix commands at Ian matrix1Util_32:
http://www.matrix1.demon.co.uk/Matrix1Utils_Help/Matrix1Util_32_index.html
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Oct 2011 21:25
BFM,
I use that method (although the camera distance and ranges are much higher) and I get some funny artifacts, such as Z-fighting and funny horizontal lines akin to "screen tearing". I was steered toward IanM's matrix1 plugin with an ortho command to use before each sync, but haven't had a chance to try it yet.


A 3D marble platformer using Newton physics.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 11th Oct 2011 22:15
I still have yet to download matrix1.
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 12th Oct 2011 07:53 Edited at: 12th Oct 2011 09:08
Hey tiresius,

What were the limitations that you discovered for the camera distance, range & FOV before you started seeing graphical artifacts occur?

Does anyone have an example of IanM's ortho command in action? I've tried a bunch of orthographic techniques, but don't recall testing IanM's one.

And regarding every single other orthographic technique that I've tested, they all come with the limitation of Pick Object command failing to work accurately.

I'm really hoping others can join us in this discussion, cause this problem (specifically the problem of having an orthographic view fully working with pick object commands) must have been solved successfully years ago.

EDIT: I can't find an ortho command when searching Matrix1 Utilities help file. Anyone?


Here's something I quickly whacked together.
Features missing:
Adjustable Camera Range
Pick Object functionality
Direct user variable input



Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 13th Oct 2011 06:58 Edited at: 13th Oct 2011 10:06
Here's an update of the above code.

Note that I couldn't help but be reminded of how tricky height can be to judge when messin' about with the orthographic view, thus I've added in a fade element for when the Y axis (height) is adjusted.



Also, here's a orthographic selection thingy I started working on ages ago, but you get the idea.

2 Cameras; Ortho & Perspective - unit selection

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th Oct 2011 06:47
I found this link. it is in somehow relevant to what you're looking for.
[href=null]
http://forum.thegamecreators.com/?m=forum_view&t=180267&b=6[/href]
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th Oct 2011 06:48
I found this link. it is in somehow relevant to what you're looking for.

[href=http://forum.thegamecreators.com/?m=forum_view&t=180267&b=6 ]http://forum.thegamecreators.com/?m=forum_view&t=180267&b=6 [/href]
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 14th Oct 2011 06:55
Thanks!
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 14th Oct 2011 07:11
Interesting basjak, but not too sure how to implement that code snippet, as it was a bit short on instructions.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 14th Oct 2011 17:02
BFM, I do not need the Pick Object so I don't know if that would be an issue as well. I was pulling the camera back 100k+ due to scaling of my game. The artifacts I saw were with Z fighting of edges next to each other. And although I didn't see this before (but maybe now with widescreen), there is now a subtle shift in pixels every 1/20 of the vertical screen. Almost like screen tearing, but not quite.

Here is my post:
http://forum.thegamecreators.com/?m=forum_view&t=160985&b=1
It shows use of IanM's "APPLY PROJECTION MATRIX4" function. I haven't gotten it to work quite right yet.


A 3D marble platformer using Newton physics.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th Oct 2011 17:02
you have to spend sometime training on such thing. the resources are very poor so you have to work it out yourself.

the link I gave will change the mouse coordinate to the centre of the screen.

Login to post a reply

Server time is: 2026-07-11 14:37:05
Your offset time is: 2026-07-11 14:37:05