3d box 'pitch' question? (SOLVED)

For questions about using Classic.

Post » Tue Mar 22, 2011 8:51 pm

Can anybody help me with the following-

My game has the following objects

A 3d Box object (gun) with 2 buttons(up and down) that change the boxes pitch.
A cross-hair sight that only moves in the Y direction (depending on the 3d boxes pitch)

The 3d boxes pitch range needs start at 24 degrees and end at -24 degrees.

When the 3d boxes pitch is at 24 the cross-hair's Y position should be 240.
When the 3d boxes pitch is at -24 the cross-hair's Y position should be 440.



Thanks in advance.
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Tue Mar 22, 2011 9:31 pm

440 or 480?

crosshair.y=lerp(440,240,(3dbox.pitch+24)/48)
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Tue Mar 22, 2011 9:56 pm

[quote="lucid":s5imr41t]440 or 480?

crosshair.y=lerp(440,240,(3dbox.pitch+24)/48)[/quote:s5imr41t]

(The Y is 440)

Thanks for responding, my next question is how do i implement this?

For example i have the following event(s)

+ down: Button clicked
-> barrel: Set pitch to barrel.Pitch-1 degrees.

What condition/ event combination would i use to set the 'crosshair's Y position? :oops:
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Tue Mar 22, 2011 10:22 pm

Thanks Lucid, i downloaded your 'quicklerptut' example and worked it out from that.

Brilliant!
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests