HTML Tags or LInks in Google o3d possible?

0 views
Skip to first unread message

int0

unread,
Nov 16, 2009, 5:33:58 PM11/16/09
to O3D-discuss
Hi,

I'm new to Google o3d and I intend to make a 3D application that
prints some 2D text on screen i.e. if a user clicks on a 3D object.
Now I'd like to put some links into the text. My question is: Is that
possible anyway? Or is there a way to add some eventlistener to a 2D
canvas object?

Thank's for every help in advance!

best regards,

Martin

CI-CUBE

unread,
Nov 17, 2009, 9:21:38 AM11/17/09
to O3D-discuss
You have all the control you need to implement this. I did implement
both 3D and HUD interactions and didn't find any limit so far.

Ekki

* GWT Rocks! * SmartGWT Rocks Even Harder! *

SmartGWT PRO/EE 1.2.1, SmartGWT 1.3, GWT 1.7.1, Eclipse 3.5.1, JRE
1.6.0_16

CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com www.EasternGraphics.com/X-4GPL

Steg

unread,
Nov 18, 2009, 12:57:47 PM11/18/09
to O3D-discuss
It's true - there are no limits in doing this but I don't think that's
what the question was necessarily getting at. If the question is
asking whether or not there is some sort of mechanism for adding links
to the 3D scene in some sort of HTML like manner, then the answer
AFAIK is no.

If you look at the "hud-2d-overlay.html" sample, that will point you
in the right direction. Essentially, you need to create a pseudo-2D
scene that is displayed on top of the 3D scene as many video games
would do - i.e. there is a separate scene graph of objects that is
rendered on top of the 3D scene using an orthographic camera to make
it look 2D. You can then set the event callback for the mousedown
event - which is set for the main client object. Inside this callback,
you then have to go through the relevant clickable objects in your
scene, doing hit tests against them and responding as required.
Basically, you have to take a fairly brute force approach to doing
this.

I had to do this recently - I wanted to add 2 or 3 buttons on top of
the 3D window and was hoping that it could be done entirely in HTML
with some simple javascript calls in the onclick handlers - but, alas,
no. Even though taking the approach I mentioned above is fairly
painless, it does involve a lot more code than

<img onclick="viewer.DoThis()"/>

which is a real shame.

Gregg Tavares

unread,
Nov 24, 2009, 3:39:22 AM11/24/09
to o3d-d...@googlegroups.com
On Mon, Nov 16, 2009 at 2:33 PM, int0 <myin...@gmail.com> wrote:

Hi,

I'm new to Google o3d and I intend to make a 3D application that
prints some 2D text on screen i.e. if a user clicks on a 3D object.
Now I'd like to put some links into the text. My question is: Is that
possible anyway? Or is there a way to add some eventlistener to a 2D
canvas object?

Basically what CI-CUBE said, you can implement this yourself but like Steg said, it's not as simple as <img onclick="handler();"/>

O3D is low-level because if we made it high enough level to handle that kind of stuff directly it would be too slow and be designed for only certain types of applications.  So instead we made something very low-level so that it's possible to implement many different high-level APIs and applications on top of it. 

On the plus side it's very flexible. On the down side you either have to implement many things yourself or wait for someone else to do it for you. My personal hope is that someone will find the time to write some higher level libraries to implement those kinds of things the same way say JQuery brings many high level things to HTML.



 

Thank's for every help in advance!

best regards,

Martin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "O3D-discuss" group.
To post to this group, send email to o3d-d...@googlegroups.com
To unsubscribe from this group, send email to o3d-discuss...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/o3d-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


CI-CUBE

unread,
Nov 25, 2009, 8:42:46 AM11/25/09
to O3D-discuss


On Nov 24, 9:39 am, Gregg Tavares <g...@google.com> wrote:

>
> On the plus side it's very flexible. On the down side you either have to
> implement many things yourself or wait for someone else to do it for you. My
> personal hope is that someone will find the time to write some higher level
> libraries to implement those kinds of things the same way say JQuery brings
> many high level things to HTML.
EB: Gregg, you know the answer! Do some pre-conditions on JS side and
I will love to contribute activities and code!!
Alternatively this could be done on GWT level. The more I think about
it the more I prefer the GWT side...
What is the official google statement with regard to O3D and GWT?
Don't want to do useless things as I'm already sufficiently
overpaced...

Ekki

* GWT Rocks! * SmartGWT Rocks Even Harder! * SmartGWT EE 1.2.1/LGPL
1.3,
GWT 1.7.1, GAE 1.2.6, Jetty 7.0.0, Eclipse 3.5.1, JRE 1.6.0_16

CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com www.EasternGraphics.com/X-4GPL
Reply all
Reply to author
Forward
0 new messages