realbasic-games
[Top] [All Lists]

Re: Looking at the origin in 3D

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Looking at the origin in 3D
From: David Grogono <dave at realsoftware dot com>
Date: Thu, 4 Jan 2007 13:50:04 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <61092 dot 216 dot 56 dot 22 dot 34 dot 1167931945 dot squirrel at mail dot athenet dot net>
Hi -

I hadn't seen your post on the games list before replying on the getting started list. It sounds like that other reply may be unneeded if you figure out how to allow the user to move the camera.

One fairly simple way I have used does something like this when xDelta and yDelta are how far the user moved the mouse:

  Rb3DSpace1.camera.Position = new Vector3D(0,0,0)
  Rb3DSpace1.camera.Yaw -.01*xDelta
  Rb3DSpace1.camera.Pitch .01*yDelta
  Rb3DSpace1.camera.MoveForward -100
  Rb3DSpace1.update

Obviously you would need to adjust the various numbers to get the responsiveness you want.

Best regards, David


On Jan 4, 2007, at 11:32 AM, tornado at athenet dot net wrote:

The user can move the camera around my object in a circle but it always
views in the same direction. I want the camera to always be facing the
object which happens to be at the origin. The radius of the circle is 750.

This is the code for the camera movement:
    Zangle=Zangle+.1//a property as double
Rb3DSpace1.Camera.Position.X=Rb3DSpace1.Camera.Position.X//this line
is not strictly necessary buy I keep it here for consistency
    Rb3DSpace1.Camera.Position.Y=(750*(Sin(Zangle)))
    Rb3DSpace1.Camera.Position.Z=(750*(Cos(Zangle)))

After that I want the camera to point towards the origin.

What would be even better is if the user could click and drag their mouse
on the RB3DSpace to move the camera.

I need to keep the object stationary to test for loctions.

Any suggections would be great.

Thanks!



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>