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.

Rotate, Pan and Zoom
Vote this thread:


@rafaeldmt

Posts: 4

NGLNewbie

Sun, Jun 10 2012


Hi,

First of all, thanks for this great engine, it looks really easy and I'm having a lot of fun!

I'm trying to do a viewer and implement Rotate, Pan and Zoom, but all my test was not good, I was trying to find it in the documentation and in the forum, but I didn't find it.

May you help me?

Thanks,

Rafa
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sun, Jun 10 2012


In response to: @rafaeldmt

Hello man,

It's simple, here is the deal:


  • Rotate: There are many ways to rotate an object. You can use the direct properties rotateX, rotateY, rotateZ. 3D rotations is a complex thing, so to help you NinevehGL offers many other ways like the rotationOrder and rotationSpace. Besides you can use rotateRelativeToX:toY:toZ:, rotateRelativeWithMatrix:, rotateRelativeWithQuaternion:, rotateToX:toY:toZ: and many other methods. Everything is well documented on the NGLObject3D, which is the base class for any kind of 3D object. (http://nineveh.gl/docs/Classes/NGLObject3D.html)
  • Pan: I'm assuming you're trying to make a camera pan, this is easy to do with the NGLCamera. To make a pan just move the camera along X, Y, Z properties. As the NGLCamera is also a NGLObject3D you can use the movement functions from there. For example moveRelativeTo:distance: or translateRelativeToX:toY:toZ: . These function can make the camera move locally in its own space coordinate, independent of the rotation state it is.
  • Zoom: The zoom is exactly the same thing as the movement. You can just move the camera or if you prefer you can change the angle of view. By changing the angleView property in the NGLCamera you can produce a zoom effect without move the camera. (http://nineveh.gl/docs/Classes/NGLCamera.html#//api/name/angleView)


Hope this helps.

Cheers,
0% like this - 0/0

@rafaeldmt

Posts: 4

NGLNewbie

Mon, Jun 18 2012


In response to: @dineybomfim

Hi,

Thanks for your information. But I'm not getting a nice result just with Rotation.

Is it possible to rotate the camera instead of rotate the object?

Is it possible to write a short sample about a rotation camera or object? I'm trying to allow to rotate with 1 finger, but all the result are without control :S

Thanks,

Rafa
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Mon, Jun 18 2012


In response to: @rafaeldmt

Hello buddy,

OK, I think I know what you want.
Maybe this video can help you to understand the rotations:


Here is the deal:
Open the "NinevehGL Lessons > Basics > Rotations.xcodeproj".
Now, replace these lines:

_cube1.x = _position.x * 0.01;
_cube1.y -= _position.y * 0.01;
[_cube1 lookAtObject:_cube2];


By these lines:

_cube2.rotationSpace = NGLRotationSpaceWorld;
[_cube2 rotateRelativeToX:_position.y toY:_position.x toZ:0];


Build and see if this is what you want.
0% like this - 0/0

@rafaeldmt

Posts: 4

NGLNewbie

Mon, Jun 18 2012


In response to: @dineybomfim

Exactly! Thanks a lot!
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.