VC:MP 0.4 (Beta) > Script Discussion

Rotating Sprites

<< < (3/3)

stormeus:
The sprites are fine, the problem is your math. Objects are rotated about an axis of 360 degrees. If a player is going 1km/h, your sprite rotates 180 degrees. If a player is going 2km/h, your sprite rotates 360 degrees. It will only rotate to 0 or 180 degrees or some derivative of it, and especially because you round to the nearest whole number.

Honey.:

--- Quote from: stormeus on October 03, 2014, 10:23:37 pm ---The sprites are fine, the problem is your math. Objects are rotated about an axis of 360 degrees. If a player is going 1km/h, your sprite rotates 180 degrees. If a player is going 2km/h, your sprite rotates 360 degrees. It will only rotate to 0 or 180 degrees or some derivative of it, and especially because you round to the nearest whole number.

--- End quote ---

Can you explain more? I didn't quite understand what you meant.

Secondly rotation problems is a different case why does the sprite move in random positions?

stormeus:

--- Quote from: Honey. on October 04, 2014, 07:36:20 am ---
--- Quote from: stormeus on October 03, 2014, 10:23:37 pm ---The sprites are fine, the problem is your math. Objects are rotated about an axis of 360 degrees. If a player is going 1km/h, your sprite rotates 180 degrees. If a player is going 2km/h, your sprite rotates 360 degrees. It will only rotate to 0 or 180 degrees or some derivative of it, and especially because you round to the nearest whole number.

--- End quote ---

Can you explain more? I didn't quite understand what you meant.

--- End quote ---

I don't know how to explain this any further without having to teach trigonometry.


--- Quote ---Secondly rotation problems is a different case why does the sprite move in random positions?

--- End quote ---

I'm going to say because you didn't remove whitespace/transparency around the speedometer sprite.

Honey.:
Is whitespace created when we enter in the vehicle by pressing the enter button? I read that  :


--- Quote --- Vertical white space is a bit more varied as to how it is encoded,but the most obvious in typing is the ↵ Enter result which creates a 'newline' code sequence in applications programs

--- End quote ---

Where is the whitespace created and how do I remove it?
Sorry for being a noob here  ;)

stormeus:
Whitespace is created when you have a PNG with transparency around the image.

Navigation

[0] Message Index

[*] Previous page

Go to full version