MASON-INTEREST-L Archives

July 2006

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 20 Jul 2006 00:38:39 +0100
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Content-Transfer-Encoding:
7bit
Subject:
From:
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
In-Reply-To:
<Pine.GSO.4.52.0607191200260.23929@cs1>
MIME-Version:
1.0
Comments:
To: MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (99 lines)
Hi Gabriel,

Thanks for the response.

After sending the email I managed to figure out how to do what I 
originally asked using, as you suggest, Display3D.transform.

I also managed to automatically centre the view (by transforming the 
objects) using the dimensions of the fields.

It would be useful to track objects, or even find (and centre on) 
objects with particular properties. I suppose it might be possible to do 
  this by continuously transforming the whole scene, but it would be 
more elegant to do this by moving the camera.


What would be nice would be the ability to create extra canvases to have 
multiple views of the same model. That way you could have one window 
tracking an object while the other displays the global context of the model.

Thanks again

-Mike

Gabriel Catalin Balan wrote:
> Hello
> 
> Your questions reveal interesting features we should have in MASON. They
> go along well with Professor Luke's idea that we should be able to have
> the camera follow a specific 3D object as it moves through the scene.
> 
> In the meantime, I think that  you should change the transformation
> (Transform3D) of universe.getViewingPlatform().getViewPlatformTransform().
> 
> So far we did not need to move the camera cause all the fields (Grids,
> or Continuous) were bounded. We'd set the scene and call
> universe.getViewingPlatform().setNominalViewingTransform(), which "sets
> the nominal viewing distance in the ViewPlatform transform based on the
> current field of view. [...] The ViewPlatform is moved back along Z so
> that objects at the origin spanning the normalized X range of -1.0 to
> +1.0 can be fully viewed across the width of the window."
> 
> To set the camera's field of view, we call
> canvas.getView().setFieldOfView() in Display3D.setScale().
> 
> 
> Instead of playing with the camera you can play with the model.
> All your stuff (java3D stuff created by your portrayal3Ds) hang from
> Display3D.globalModelTransformGroup. This group (i.e everything inside)
> can be transformed (scaled, translated, rotated) using
> Display3D.transform, or the more user friendly translate, scale, rotateX,
> rotateY, rotateZ.
> 
> If your scene grew bigger than before, scale everything back down.
> Did your 3d objects run more to the right than to the left? You can either
> move the camera to the right or move the entire world to the left.
> 
> Hope this helps,
> Gabriel Balan
> 
> 
> On Wed, 19 Jul 2006, MASON-INTEREST-L automatic digest system wrote:
> 
>> There is 1 message totalling 41 lines in this issue.
>>
>> Topics of the day:
>>
>>   1. Display3D viewing and camera operations
>>
>> ----------------------------------------------------------------------
>>
>> Date:    Tue, 18 Jul 2006 14:24:06 +0100
>> From:    Michael Lees <[log in to unmask]>
>> Subject: Display3D viewing and camera operations
>>
>> Hello all,
>>
>> I have a couple of questions - hopefully fairly straightforward.
>>
>> Both relate to changing the default view of the camera when using Display3D.
>>
>> Q1. I've figured out how to change the scale, using the Display3D.scale
>> method. However, I haven't managed to change the view point. How do I do
>> this? So for example how do I get the camera centred on (10,10,10)
>> looking down/up the z axis (or whatever is default).
>>
>> Q2. I'm actually trying to centre the view at the middle of a cube (the
>> view can be along any axis as long as it points to the centre of the
>> cube). I would have thought it'd be possible to write a centre method
>> which automatically moves the camera (and perhaps alters scale) so that
>> it points at the centre of the scene (and possibly scales to fit in the
>> whole scene).
>> You would just need to know the smallest and largest x,y,z of all fields
>> in the model.
>>
>> Thanks for the help
>>
>>

ATOM RSS1 RSS2