This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Several objects


Several objects

Postby meiline » May 15, 2007 @ 5:14pm

Hello,

I'm trying to load several objects, but it doesn't work like I want. I explain myself:

If an object is inside another one, they seem that they are superposed. For example, I have two objects in format 3ds. A cup and a spoon. The spoon is inside the cup. If I load both objects with 3D studio, is correctly. But when I load them with the EDGELIB functions it seems that the spoon is outside the cup.

How can I do to get this effect?
Have I explained myself well? I must apologize for my English. I'm sorry.:oops:

Thanks a lot. :lol:
User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby edge » May 16, 2007 @ 11:03am

Hi Meiline,

Can you tell me which method you use for rendering the 3D objects?

If you're using the EDGELIB internal renderer, it's currently not possible to do proper object sorting when drawing multiple objects. The best way to solve it is to merge the objects before rendering.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby meiline » May 16, 2007 @ 2:59pm

User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby meiline » May 18, 2007 @ 8:17am

Hi again!

I have tried to merge the objects, but I don't achieve my purpose.

I have read: "Setting up the OpenGL ES display is handled by the Edge SDK, enabling developers to start outputting 3D models right away. In addition, Edge's existing E3DSurface interface can be used in combination with the 3D Studio Max 3DS loader to easily load 3D models in OpenGL ES powered applications."

So my question now is: If I load my 3ds object in E3DSurface, ¿how can I render it with OpenGL ES? ¿Is it possible?

Thanks a lot of. Best regards.
User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby Rye » May 18, 2007 @ 8:27am

Im no expect on the subject so could be way off here but, wouldn't you have to first move the spoon surface inside the 3d space of the cup?

Without first moving the spoon it would appear in front of the cup but if you moved the spoons z axis to be in the range of the cups it would give the effect it is inside it.

Or maybe it is because you are rendering the cup and THEN the spoon?

Just a guess...
Rye
pm Member
 
Posts: 5
Joined: May 5, 2007 @ 1:07pm


Postby meiline » May 18, 2007 @ 11:27am

Hi Rye,

Thanks for your guess.

If I render the cup and then the spoon, the effect is "the spoon is in front of the cup". If I render the spoon first, the result is "spoon is behind the cup"
I'd like to have the effect "the spoon is inside the cup" That means: if you see the scene in one part the cup cover the spoon, but in another part, the spoon cover the cup

Thanks anyway!! :)
User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby napoleondynamite » May 18, 2007 @ 2:36pm

There is no spoon.

Sorry, I couldn't resist! No idea how to fix your problem, though :wink:
napoleondynamite
pm Member
 
Posts: 11
Joined: Dec 9, 2005 @ 12:54am


Postby edge » May 18, 2007 @ 3:10pm

Hi Meiline,

To enable OpenGL ES, you can define EGL_USEGL before including edgemain.h and link the necessary libraries. It may be needed to download an SDK, for example PowerVR or Rasteroid.

For more information look at the View3D and Animate3D samples or read our tutorial here: http://www.edgelib.com/index.php?node=1093
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby kuroneko » May 20, 2007 @ 3:55am

kuroneko
pm Member
 
Posts: 14
Joined: Mar 27, 2007 @ 5:38am


Postby edge » May 20, 2007 @ 3:27pm

Well, actually it's a problem with depth sorting in the internal EDGELIB renderer (which isn't based on OpenGL and doesn't have a z-buffer). The internal EDGELIB renderer is used when OpenGL isn't enabled.

Both objects are rendered by z-sorting the polygons. Because the first object is already drawn before the second object, the second object will be rendered on top of that without looking at the rotation or position of the objects. The only solution for this would be to draw both objects in one render call. Of course, this only applies when using the internal EDGELIB renderer instead of using OpenGL.

When OpenGL is enabled, it will render properly because OpenGL has a z-buffer. This buffer is automatically enabled in the OpenGL configuration.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby meiline » May 21, 2007 @ 3:04pm

User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby edge » May 22, 2007 @ 10:21am

Hi Meiline,

Actually, the call to display->Render(&cup) will have the ability to render to OpenGL. If OpenGL is enabled, first call display->Perspective3D before calling display->Render(). For an example, please look at the view3D sample, bundled with the SDK.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby meiline » May 22, 2007 @ 3:31pm

User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Postby edge » May 23, 2007 @ 3:24pm

Hi Meiline,

Can you tell me which OpenGL ES implementation you're using? Would you like to recompile the View3D sample and try to run it on your device? Does it generate an error message?

If the problem only occurs with your project we recommend adding an EGL_POWERVR or EGL_RASTEROID definition to your Embedded Visual C++ project. If you're using the Edge IDE you can see this definition when editing the project file with a text editor.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby meiline » May 25, 2007 @ 11:40am

User avatar
meiline
pm Member
 
Posts: 30
Joined: May 10, 2007 @ 12:33pm


Next

Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron