Login Action Required

The NinevehGL Forum uses a new concept of "socialized forum" or as we like to say "Tweet Forum".


Here is the deal:
  1. No new registration is required. Just sign in with your Twitter account and authorize the NinevehGL Forum.
  2. Once you’re in, you'll be able to "Follow a Thread", that means every time that thread receive a new post or update you'll receive a mention on your twitter.
  3. Besides, you can enable "Auto Share", then every new post and/or thread you make will be tweeted on your timeline. (By default, auto-share is enabled only for your threads)

Forum Rules:

1. We understand human comunication can become "hot" sometimes. So some insults and bad words ARE allowed. Just don't push too much being an asshole all the time.

2. SPAMMERS are not allowed. There are penalties for this kind of user and they can be banned forever.

3. You can report other users, if you judge necessary. An user reported many times by many people can also be banned forever. However you can also receive penalties for report deliberately for no apparent reason.

If there is a similar thread title, make sure the other one doesn't already have the answer you're looking for.

This forum uses the BBCode (Bulletin Board Code), here are some instructions:

Bold: [b]text[/b]
Italic: [i]text[/i]
Underline: [u]text[/u]

Code: [code]text[/code]
Quote:
[quote=@username]text[/quote]
[quote]text[/quote]

List:
[ul] [*]item [/ul]
[ol] [*]item [/ol]

URL:
[url]http://url.com[/url]
[url=http://url.com]text[/url]

Image:
[img]http://imageurl.com[/img]

Embed (videos, code, 3D):
[embed]http://url.com[/embed]

Welcome to the NinevehGL's world!
NinevehGL is a 3D engine forged with pure Obj-C.
Welcome to the
Forum!
Hello, Guest.

Your current vote:

You can change your vote many times. But it's still one single vote.

Get view width in terms on OpenGL coordinates?
Vote this thread:


@zmarcantel

Posts: 2

NGLNewbie

Mon, Nov 11 2013


Is there a predictable way to get the "width" of the view in terms of how far an object can be translated before it goes off the screen?

I see the camera's aspect ratio and view angle. Is it calculated off of that?
I tried using the sin/cos of the view angle mixed with the distance from the camera to the model, but that didn't seem to work (close, but never exact).

Has anyone figured this out?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Mon, Nov 11 2013


In response to: @zmarcantel

Hello buddy,

You probably will not get such precision when talking about 3D world and OpenGL.

1. Because there are no pixels in OpenGL, it works with fragments, which can be fractions of a pixel.

2. The iOS floating point is far from good right now. It loose precision because iOS is a 32bits platform trying to simulate virtual 64bits (at least the iPhone 5S arch armv64, as the NinevehGL is compiled with the arch armv7s, it does not take advantage of a 64bits platforms anyway).

3. Is really hard to reach the exactly point of precision when you're playing with so high precision, like in 3D world space. A very small difference like 0.00001 to 0.000011 can make your object completely be vanished from the screen depending on the other players, like cameras and screen.

So, my advice to you is this:
Think about if you really need 3D to achieve your goal. If the precision is something really important to you, you should keep on the UIKit universe, where the pixels are really pixels and you can get the precision you want.
0% like this - 0/0

@zmarcantel

Posts: 2

NGLNewbie

Mon, Nov 11 2013


In response to: @dineybomfim

It's not the precision I need. What I need is some sort of bounds detection.

I will have multiple models following a flocking algorithm, and all I want is for them to turn when approaching the screen edge. My calculations are close enough, but feel hackish.

I suppose I'll keep it as is, as it works, but I was just hoping for a 'viewableArea' type property that I was missing.
0% like this - 0/0
Technology

NinevehGL is a 3D engine built right on top of OpenGL ES and it uses all the programmable pipeline power, making it easy for you to create great application with shaders.

Share on


Follow NinevehGL
Fastest way to contact us:

Copyright © 2011 db-in. All rights reserved.