AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trouble Picking with my own VirtualUniverse on Ortho Project

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
tiago.cardoso
Guest





PostPosted: Sat Jan 06, 2007 1:16 am    Post subject: Trouble Picking with my own VirtualUniverse on Ortho Project Reply with quote



Hello,

I made a simple app with a simpleUniverse. After testing it and using
picking (worked fine).

I decided to implement the real app. The real app has to be in Ortho
projection and have tranformations on the viewbranch.

So, I implemented the a class extending virtualuniverse. I did
everything "by the book" I think and everything worked fine as for the
visual aspect, object showed up in the right place and the view was
right.

Now, I'm trying to use pickcanvas but it doesn't work at all Sad
I've search a lot on the web and I already saw that there some kind of
problem with the pickcanvas pickshape for the customized
virtualuniverse.
In fact, the PickShape orign point, direction and start point don't
seem to make any sense at all.
(my objects have about 100 of size and the camera is ver faraway, and
the pickshape point is about (-0.07767107179733918,
-0.2967893129673346, 0.4174332443807395) although it changes - though I
don't understand how and why)

My universe has only a Locale. A world branch where I have my objects
and a view branch with my viewplataform and where I apply my
tranformgroup to change the camera point of view.
I use...

projection2.ortho(0, _width, 0, _height, -BACK_CLIP_DISTANCE,
BACK_CLIP_DISTANCE);

Transform3D cameratransf= new Transform3D();
this.getTransformGroup().getTransform(cameratransf);
projection2.mul(cameratransf);
view.setLeftProjection(projection2);

.... to have a ortho projection.

Any tips.. plz ?? :D

Thanks!

Tiago Cardoso
Back to top
Thomas Partsch
Guest





PostPosted: Sat Jan 06, 2007 1:52 am    Post subject: Re: Trouble Picking with my own VirtualUniverse on Ortho Pro Reply with quote



Hi Tiago!

I know that problem. It is discussed before in that newsgroup under the
title "SimpleUniverse vs VirtualUniverse". I had the same idea as you
had, that it would be a problem with the universe. But it isn't.

The problem is that you activated the View's compatibility mode. That is
to apply camera based options to the View model as you did (
setLeftProjection(t3d) ). But this is not the original intention of the
Java 3D View Model. The Java 3D View Model works different (see
PhysicalBody and PhysicalEnvironment).

Fact is, that the PickBehaviors don't work in compatibility mode. I just
wrote a dissertation about an application using that compatibility mode
(and the camera based model) and I used a frustum. I found no way to
make the pickbehaviors work. So I implemented a key control.

You'll find further information at
download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/doc-files/ViewModel.html
I would recommend read that document. It can probably explain the things
better than I can at the moment ;)

hth
Thomas Partsch

tiago.cardoso schrieb:
Quote:
Hello,

I made a simple app with a simpleUniverse. After testing it and using
picking (worked fine).

I decided to implement the real app. The real app has to be in Ortho
projection and have tranformations on the viewbranch.

So, I implemented the a class extending virtualuniverse. I did
everything "by the book" I think and everything worked fine as for the
visual aspect, object showed up in the right place and the view was
right.

Now, I'm trying to use pickcanvas but it doesn't work at all Sad
I've search a lot on the web and I already saw that there some kind of
problem with the pickcanvas pickshape for the customized
virtualuniverse.
In fact, the PickShape orign point, direction and start point don't
seem to make any sense at all.
(my objects have about 100 of size and the camera is ver faraway, and
the pickshape point is about (-0.07767107179733918,
-0.2967893129673346, 0.4174332443807395) although it changes - though I
don't understand how and why)

My universe has only a Locale. A world branch where I have my objects
and a view branch with my viewplataform and where I apply my
tranformgroup to change the camera point of view.
I use...

projection2.ortho(0, _width, 0, _height, -BACK_CLIP_DISTANCE,
BACK_CLIP_DISTANCE);

Transform3D cameratransf= new Transform3D();
this.getTransformGroup().getTransform(cameratransf);
projection2.mul(cameratransf);
view.setLeftProjection(projection2);

... to have a ortho projection.

Any tips.. plz ?? :D

Thanks!

Tiago Cardoso
Back to top
tiago.cardoso
Guest





PostPosted: Sun Jan 07, 2007 3:23 am    Post subject: Re: Trouble Picking with my own VirtualUniverse on Ortho Pro Reply with quote



Hey Thomas,

Thanks for the info. I'd already seen "SimpleUniverse vs
VirtualUniverse" and the link you said but I was still a bit confused.
So, does it mean that to have a Ortho Projection I'll have to be in
Compatible Mode or is there any alternative to "setLeftProjection" ?

I'll like to do everything without the Compatible mode as this is the
better way to keep thing working in most places, I suppose!

If it isn't possible in my case, this means that I'll have to create my
own pickshape, right ? Do you know any place where I can learn to do
this in ortho, if needed ?

Once again, thanks :D

Take care,

Tiago Cardoso

Thomas Partsch wrote:
Quote:
Hi Tiago!

I know that problem. It is discussed before in that newsgroup under the
title "SimpleUniverse vs VirtualUniverse". I had the same idea as you
had, that it would be a problem with the universe. But it isn't.

The problem is that you activated the View's compatibility mode. That is
to apply camera based options to the View model as you did (
setLeftProjection(t3d) ). But this is not the original intention of the
Java 3D View Model. The Java 3D View Model works different (see
PhysicalBody and PhysicalEnvironment).

Fact is, that the PickBehaviors don't work in compatibility mode. I just
wrote a dissertation about an application using that compatibility mode
(and the camera based model) and I used a frustum. I found no way to
make the pickbehaviors work. So I implemented a key control.

You'll find further information at
download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/doc-files/ViewModel.html
I would recommend read that document. It can probably explain the things
better than I can at the moment ;)

hth
Thomas Partsch

tiago.cardoso schrieb:
Hello,

I made a simple app with a simpleUniverse. After testing it and using
picking (worked fine).

I decided to implement the real app. The real app has to be in Ortho
projection and have tranformations on the viewbranch.

So, I implemented the a class extending virtualuniverse. I did
everything "by the book" I think and everything worked fine as for the
visual aspect, object showed up in the right place and the view was
right.

Now, I'm trying to use pickcanvas but it doesn't work at all Sad
I've search a lot on the web and I already saw that there some kind of
problem with the pickcanvas pickshape for the customized
virtualuniverse.
In fact, the PickShape orign point, direction and start point don't
seem to make any sense at all.
(my objects have about 100 of size and the camera is ver faraway, and
the pickshape point is about (-0.07767107179733918,
-0.2967893129673346, 0.4174332443807395) although it changes - though I
don't understand how and why)

My universe has only a Locale. A world branch where I have my objects
and a view branch with my viewplataform and where I apply my
tranformgroup to change the camera point of view.
I use...

projection2.ortho(0, _width, 0, _height, -BACK_CLIP_DISTANCE,
BACK_CLIP_DISTANCE);

Transform3D cameratransf= new Transform3D();
this.getTransformGroup().getTransform(cameratransf);
projection2.mul(cameratransf);
view.setLeftProjection(projection2);

... to have a ortho projection.

Any tips.. plz ?? :D

Thanks!

Tiago Cardoso
Back to top
Thomas Partsch
Guest





PostPosted: Sun Jan 07, 2007 11:50 pm    Post subject: Re: Trouble Picking with my own VirtualUniverse on Ortho Pro Reply with quote

tiago.cardoso schrieb:
Quote:
Hey Thomas,

Thanks for the info. I'd already seen "SimpleUniverse vs
VirtualUniverse" and the link you said but I was still a bit confused.
So, does it mean that to have a Ortho Projection I'll have to be in
Compatible Mode or is there any alternative to "setLeftProjection" ?

If you want to use Transform3D.ortho(...), you have to set it with
setLeftProjection. And this is only possible in compatibility mode.

Quote:
I'll like to do everything without the Compatible mode as this is the
better way to keep thing working in most places, I suppose!

This would be indeed better, because you would not have to give up the
standard behaviors. Unfortunately I don't know a way to set ortho
projection differently. I would appreciate any answer to this problem;
it could also help my project. The time given for my project was too
short to find that out... (and now I want to have some freetime Smile )

Quote:
If it isn't possible in my case, this means that I'll have to create my
own pickshape, right ? Do you know any place where I can learn to do
this in ortho, if needed ?

No, sorry. But keep me informed.

Quote:
Once again, thanks Very Happy

No worries
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.