Java-Gaming.org
 Featured games (81) games approved by the League of Dukes Games in Showcase (497) Games in Android Showcase (114) games submitted by our members Games in WIP (563) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 LOD tactics  (Read 813 times) 0 Members and 1 Guest are viewing this topic.
zingbat

Senior Member

Java games rock!

 « Posted 2003-11-17 20:14:50 »

Im trying some LOD techniques. One of the techniques requires the existence of multiple 3d models for the same object. But to know how many models are required i need to know a few things.
One is to able to calculate the size of a pixel in the view plane. Lets say that field of view is 45 degress, the plane distance is 1000 meters and the screen resolution is 800x600 pixels. How do i know the size of the pixel in meters ?

Another technique requires replacing an individual object by a flat image. What variables do i have to look at to know when to replace a 3d object with a flat image representation ?

Another technique is to palce a group of objects in something like a "system". This technique is the only one im considering for deleting and adding objects to a scene dynamically. Lets say i have a set of objetcs for a group of birds. When this group of birds is seen faraway the system contains less objects. As anyone done anything similar to this ?
cfmdobbie

Senior Member

Medals: 1

Who, me?

 « Reply #1 - Posted 2003-11-17 21:51:42 »

Quote
One is to able to calculate the size of a pixel in the view plane. Lets say that field of view is 45 degress, the plane distance is 1000 meters and the screen resolution is 800x600 pixels. How do i know the size of the pixel in meters ?

Trigonometry.  Field of view is 45 degrees = 800 pixels.  Half the screen is 22.5 degrees = 400 pixels.  By trig, 1000 tan 22.5 = 414.21 metres, which we know is 400 pixels, so each pixel is 1.04 metres in width.  If your aspect ratio is correct, the height will be the same.

So: (distanceToPlane * tan(fov / 2)) / (horizontalResolution / 2) = visible width of pixel in metres.

Quote
Another technique requires replacing an individual object by a flat image. What variables do i have to look at to know when to replace a 3d object with a flat image representation ?

When to replace it?  Depends on the application, surely?  Just pick a distance that seems "reasonable" in your coordinate system and try it.  If it looks too close, push it back.  If you don't notice it, pull it forward until you do, then push it back a little.

Hellomynameis Charlie Dobbie.
Herkules

Senior Member

Friendly fire isn't friendly!

 « Reply #2 - Posted 2003-11-18 04:50:47 »

urgs - I just used Java3Ds LOD behavior ..... too simple??

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
zingbat

Senior Member

Java games rock!

 « Reply #3 - Posted 2003-11-18 19:04:14 »

Quote

Trigonometry.  Field of view is 45 degrees = 800 pixels.  Half the screen is 22.5 degrees = 400 pixels.  By trig, 1000 tan 22.5 = 414.21 metres, which we know is 400 pixels, so each pixel is 1.04 metres in width.  If your aspect ratio is correct, the height will be the same.

So: (distanceToPlane * tan(fov / 2)) / (horizontalResolution / 2) = visible width of pixel in metres.

I think your solution works. I realize now that i needed some more information to extimate the LOD geometry to use.

The problem is how to compute the distance in pixels between two points (wherever they are) when projected in the view plane. Suposing the info related to fov and the view plane distance is the same as in post above. How can we solve this ?

Im thinking in calculating the he distances between two extreme points in the bounding box of an object. Then based on the distance between the two in pixels i would choose what LOD geometry to use.

For instance if an object is going to be projected in a rectangular region of 10x10 pixels on the screen i would probably choose a LOD geometry with at most 10 vertices wide and 10 vertices equaly distributed.

Or i would use a flat image. Which probably would be a much better solution if the object is far enough and considering it is only 10x10 pixels. Just what are the known problems on using flats to replace geometry ?
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 Add your game by posting it in the WIP section, or publish it in Showcase. The first screenshot will be displayed as a thumbnail.
 BurntPizza (16 views) 2014-09-19 03:14:18 Dwinin (34 views) 2014-09-12 09:08:26 Norakomi (61 views) 2014-09-10 13:57:51 TehJavaDev (84 views) 2014-09-10 06:39:09 Tekkerue (42 views) 2014-09-09 02:24:56 mitcheeb (64 views) 2014-09-08 06:06:29 BurntPizza (47 views) 2014-09-07 01:13:42 Longarmx (35 views) 2014-09-07 01:12:14 Longarmx (39 views) 2014-09-07 01:11:22 Longarmx (36 views) 2014-09-07 01:10:19
 BurntPizza 38x Riven 18x Rayvolution 17x princec 17x basil_ 16x ags1 16x KevinWorkman 15x kevglass 12x LiquidNitrogen 11x nsigma 11x theagentd 11x HeroesGraveDev 9x The Lion King 7x SHC 6x Gibbo3771 6x cylab 6x
 List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27Resources for WIP games2014-08-01 16:20:17Resources for WIP games2014-08-01 16:19:50List of Learning Resources2014-07-31 16:29:50List of Learning Resources2014-07-31 16:26:06List of Learning Resources2014-07-31 11:54:12HotSpot Optionsby dleskov2014-07-08 01:59:08
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org