Author Topic: Moving 3D objects  (Read 1358 times)

Offline bjimenez

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
Moving 3D objects
« on: 2012-Jan-14 »
Hi,

Ok, it seems moving 3D graphics is very different the a 2D graphic, so what I'm wondering is there some way of easily doing this? Say I want to have a 3D graphic follow the mouse movement on a touch screen. How would I go about doing this?
« Last Edit: 2012-Jan-14 by bjimenez »

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5064
  • O Rly?
    • View Profile
Re: Moving 3D objects
« Reply #1 on: 2012-Jan-14 »
Use X_SCREEN2WORLD and X_MOVEMENT :)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline bjimenez

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
Re: Moving 3D objects
« Reply #2 on: 2012-Jan-14 »
Thanks I know those commands, but how do I convert the mouse x and y position to the 3D x y position?

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: Moving 3D objects
« Reply #3 on: 2012-Jan-15 »
Hi bJimenez for make this you have 2 commands...

World2screen
and screen2world

The first from 3D to 2D and the other the inverse...

Another way for know the measures of the screen in 3D, it´s very easy:

In 2D create a line in the middle of the screen from top to down... and plave the 3D object just in th 0.0.0  3D world coorinates....

Put a counter... for right and Left, and a simple print, whit this values... it´s the same in right and left , but whit the - signus... I remenber
whit this values 1,1000,45 the values are 5 and -5, sorry perhaps this values are wrong...

Offline bjimenez

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
Re: Moving 3D objects
« Reply #4 on: 2012-Jan-16 »
Hi bJimenez for make this you have 2 commands...

World2screen
and screen2world

The first from 3D to 2D and the other the inverse...

Another way for know the measures of the screen in 3D, it´s very easy:

In 2D create a line in the middle of the screen from top to down... and plave the 3D object just in th 0.0.0  3D world coorinates....

Put a counter... for right and Left, and a simple print, whit this values... it´s the same in right and left , but whit the - signus... I remenber
whit this values 1,1000,45 the values are 5 and -5, sorry perhaps this values are wrong...

Thank you, after some thought, I think I'll just stick to 2D graphcs for now.