Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: MoveRelative.  (Read 927 times)
PhunkeyMonkey
Customers
Community Member
*****
Posts: 126


WWW
« on: March 02, 2005, 09:43:28 PM »

pInput->GetAbsMouseState( &iX, &iY, &b1 /*left*/, &b2/*right*/, &b3, &b4, &bR/*mouse roll*/ );

niX = iX - oiX, oiX = iX; // X Push value
niY = oiY - iY, oiY = iY; // Y Push Value

if( niX != 0 && b2 )
  pScene->GetCamera()->MoveRelative( 0.f, 0.f, niX * tick, false ); // Pan left/right around model

When executing this, it rotate's around the model correct, but it also moves the camera position back more.. so eventually if you keep spinning around the camera moves so far back that you don't see anything.. this shouldn't occur unless i am doing something totally wrong that i am unaware about.
Logged

The above post may have been posted by one of many programmers at our college, if you find it offensive, please let us know.
tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #1 on: March 02, 2005, 10:31:37 PM »

use math.movearoundpoint it works much better
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
PhunkeyMonkey
Customers
Community Member
*****
Posts: 126


WWW
« Reply #2 on: March 02, 2005, 10:36:54 PM »

It still means that MoveRelative has a bug in it. avoiding it doesn't fix a problem in the engine..


But i will look into math.movearoundpoint for now until it is fixed.
Logged

The above post may have been posted by one of many programmers at our college, if you find it offensive, please let us know.
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #3 on: March 04, 2005, 02:56:07 PM »

There is no bug actually.

It's the logic behind that is wrong.

If the Tick was infinitesimal, it would work and do a good circle around.
However in your case the tick isn't small enough, and it gives problems.
So you can't use a relative method, prefer trigonometry or MoveAroundPoint method, that will always work better.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Waterman
Moderator
Community Member
*****
Posts: 1157


« Reply #4 on: March 04, 2005, 04:12:09 PM »

Or estimate (based on frame rate) where the next point on the circle is, and move towards that instead of in the tangent direction.
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
Anti-Gremlin
Community Member
*
Posts: 862


WWW
« Reply #5 on: March 07, 2005, 06:37:55 AM »

Yeah i used MoveAroundPoint() which works well.
Logged

Project: It's a secret..
Progress: <secret progress>
TV3D Chat: http://www.voidzero.com/chat/chatter.cgi?channel=tviug
TV3D Wiki Doc: http://wiki.truevision3d.com/
TV3D TVDN: http://www.truevision3d.com/tvdna/
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks