Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: mouse coordinates [Re: BastovBros] #277446
07/09/09 10:28
07/09/09 10:28
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
yep, very nice solution smile


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: mouse coordinates [Re: VeT] #277472
07/09/09 11:44
07/09/09 11:44
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
btw, for speed up, you can overload function vec_dist() for 2d vectors, or create new
Code:
var dist2d(VECTOR* vector1, VECTOR* vector2)
{
	VECTOR* temp_v;
	var distance;
	temp_v.x = vector1.x - vector2.x;
	temp_v.y = vector1.y - vector2.y;
	return distance = sqrt(temp_v.x*temp_v.x + temp_v.y*temp_v.y); 
}



This one works fine for me.


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: mouse coordinates [Re: VeT] #277506
07/09/09 12:51
07/09/09 12:51
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Just as a side note I forgot to add, I was clumsying around getting it to work but it was acting weird all the time, while in my head the calculations were right. Turned out temp2_pos.z wasn't at 0 (because VECTOR temp2_pos; doesn't initialise its members (x, y, z) to 0, but leaves it with some random pointer address), so vec_dist returned a very awkward value.

Setting temp2_pos.z to 0 helped alot wink.


Click and join the 3dgs irc community!
Room: #3dgs
Re: mouse coordinates [Re: Joozey] #277542
07/09/09 14:57
07/09/09 14:57
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
what about this initialization ? wink
Code:
VECTOR* temp2_pos = {x=0;y=0;z=0;}




1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: mouse coordinates [Re: VeT] #277548
07/09/09 15:30
07/09/09 15:30
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Fine as well grin as long as all members are set.


Click and join the 3dgs irc community!
Room: #3dgs
Re: mouse coordinates [Re: BastovBros] #331640
07/05/10 14:36
07/05/10 14:36
Joined: May 2008
Posts: 62
México.
F
FcoElizalde Offline
Junior Member
FcoElizalde  Offline
Junior Member
F

Joined: May 2008
Posts: 62
México.
Thanks for the mouse_pos limiter, but why it doesnt work when mouse_sync=1; ?

Re: mouse coordinates [Re: FcoElizalde] #331720
07/05/10 21:56
07/05/10 21:56
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Because this syncronises your mouse with the windows mouse cursor. To change its position you can use SetCursorPos.

Btw, why are you posting in a thread that is now almost a year old? wink

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1