Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Search Today's Posts Mark Forums Read
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 13-10-2010, 02:16 PM   #1
Mighty Midget
Pox Vobiscum
 
Mighty Midget's Avatar


 
Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
Default 3D controllable ball programming

or rather, a 3D controllable line program.

Since I don't know the first thing about programming, and since asking doesn't hurt, I'll throw out this question:

Anyone knowledgable in 3D modelling and programming? What I look for is a 3 dimensional representation of a line that can be rotated around a fixed point in all directions. It also has to be able to rotate around its own axis.

Practical use: An rc helicopter orientation training tool.

It does not have to behave like a heli in all respects, but it has to be able to rotate and flip around the fixed point. Some representation of the helicopter's nose is needed to, some sort of marker that will rotate when the line rotates around its own axis.

There are 3 controls that will be used. 2 for the rotation around the fixed point, and 1 for the rotation around the axis. The idea is to be able to use a 4 axis USB joystick shaped like an rc transmitter, two sticks, each movable along two axis.

If you are unfamiliar with rc transmitters: In rc, the transmitters come set up in one of several "modes". Mode 2, used in the US and many European countries, means:
-flipping the line around a fixed point is controlled with the right stick. The position of the nose defines the direction the line will flip when the stick is moved forward. Stick forward, line flips towards the nose. Left, right, backwards is thereby also defined.
-Rotating the line around its own axis is controlled by moving the left stick left or right for ccw or cw rotation.

The program has to let the user use a transmitter-ish controller. The aim is to let the user learn how to move the line around as it flips and rotates, without having to worry about the heli moving anywhere.

Now: I have no idea how easy or difficult it would be to make such a program, but I'm gonna ask: Does it sound interesting enough as a pet project?
__________________
Je Suis Charlie
Mighty Midget is offline                         Send a private message to Mighty Midget
Reply With Quote
Old 13-10-2010, 02:38 PM   #2
Kippesoep
Forum hobbit
 
Kippesoep's Avatar


 
Join Date: Nov 2007
Location: Etten, Netherlands
Posts: 34
Default

Technically, I think quaternions are the way to represent this. Graphically, might be useful to show a helicopter twice (or three times). One as a reference or target, and one as the current position (with the line), possibly ghosted. This makes it easier to see the rotation about its own axis, as a line rotating about its own length does not look any different from the original. Perhaps use arrows instead.

When making use of pre-existing 3D engines, it should be relatively easy to do this in an afternoon or so.
Kippesoep is offline                         Send a private message to Kippesoep
Reply With Quote
Old 13-10-2010, 02:55 PM   #3
Mighty Midget
Pox Vobiscum
 
Mighty Midget's Avatar


 
Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
Default

Thanks, kippo.

About showing a 3D heli model, I'm really not sure. As a pilot, my focus is on the rotor hub (the moving end of the line) and the rotor mast (the line) and the difficulties in keeping oriented reaches an impossible level if I focus on anything else. However, I do need an indicator that shows where the nose is pointing. An arrow works fine. Or, imagine a right angled hex key, the long side being the mast, the short being the nose. The idea is to keep the amount of information the pilot has to process to a bare minimum, and all he needs to consider will be the line (mast) and an indicator/arrow (nose).

The crucial thing is, it is the circular disc's tilt- (and consequently the mast's tilt-) direction that will determin where the heli is going to move. As a circle, there is no such thing as "front", "left", "right" or "backwards". All directions are equal to a circle. The nose reference's sole purpose is to tell the pilot where he needs to move the right stick to tilt the mast in the desired direction. Therefor, a line and not a full heli model, will be the best way to learn, the way I see it. Or in other words: the disc and mast are all that really matter, the rest is only there for the ride.
__________________
Je Suis Charlie
Mighty Midget is offline                         Send a private message to Mighty Midget
Reply With Quote
Old 13-10-2010, 03:11 PM   #4
Kippesoep
Forum hobbit
 
Kippesoep's Avatar


 
Join Date: Nov 2007
Location: Etten, Netherlands
Posts: 34
Default

Quote:
Originally Posted by Mighty Midget View Post
About showing a 3D heli model, I'm really not sure. As a pilot, my focus is on the rotor hub (the moving end of the line) and the rotor mast (the line) and the difficulties in keeping oriented reaches an impossible level if I focus on anything else. However, I do need an indicator that shows where the nose is pointing. An arrow works fine. Or, imagine a right angled hex key, the long side being the mast, the short being the nose. The idea is to keep the amount of information the pilot has to process to a bare minimum, and all he needs to consider will be the line (mast) and an indicator/arrow (nose).

The crucial thing is, it is the circular disc's tilt- (and consequently the mast's tilt-) direction that will determin where the heli is going to move. As a circle, there is no such thing as "front", "left", "right" or "backwards". All directions are equal to a circle. The nose reference's sole purpose is to tell the pilot where he needs to move the right stick to tilt the mast in the desired direction. Therefor, a line and not a full heli model, will be the best way to learn, the way I see it. Or in other words: the disc and mast are all that really matter, the rest is only there for the ride.
The model should then be really simple. Could be a disc with an arrow sticking out perpendicular to it ("up" -- matches the axis) and another one that represents the nose ("front" -- matches the orientation, rotating around the "up" axis). Note, "front" is not the same as "forward" (which in this case can be found by projecting the "up" axis onto the ground plane, assuming no change in altitude).
Kippesoep is offline                         Send a private message to Kippesoep
Reply With Quote
Old 13-10-2010, 03:22 PM   #5
Mighty Midget
Pox Vobiscum
 
Mighty Midget's Avatar


 
Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
Default

First: You are right in assuming altitude or any movement through the air will be ignored completely. That would be the next step in the learning process, but outside the purpose of this "orientation simulator".

As for the disc, it can also be ignored (for this purpose) as it will always be close enough to perpendicular to the mast.

The idea about the line rotating around a fixed point is based on how a heli flips around: When a heli flips, it flips around its centre of gravity, which will be close enough to the main mast to say it is _on_ the main mast. The line is really an imaginary line between CG and the rotor hub but like I said, if CG is on the mast, then that imaginary line will be where the mast is.

Bottom line is: 4 things are needed: CG (the fixed point), a line (the mast) and the moving end of that line (the disc hub) and finally the nose indicator. Everything else can be ignored completely.

As for simple: That's what I want . A simplified "physics model" that only shows what I want to study and nothing else.
__________________
Je Suis Charlie
Mighty Midget is offline                         Send a private message to Mighty Midget
Reply With Quote
Old 13-10-2010, 03:44 PM   #6
Kippesoep
Forum hobbit
 
Kippesoep's Avatar


 
Join Date: Nov 2007
Location: Etten, Netherlands
Posts: 34
Default

Quote:
Originally Posted by Mighty Midget View Post
As for the disc, it can also be ignored (for this purpose) as it will always be close enough to perpendicular to the mast.
I think it is necessary to be able to see how it points. Just drawing lines makes for ambiguous orientations, think about the famous wireframe box that you can see in either of 2 orientations, both equally valid. The disc removes all ambiguity:

green = "up", blue = "front", "forward" is not visible, but would be pointing horizontally to the left.
(although to make it more visually appealing, I would actually replace that disc by a simple 3D model of a helicopter, though it would be necessary not to make it too "in your face" as that is not the point of the exercise).

Quote:
Originally Posted by Mighty Midget View Post
The idea about the line rotating around a fixed point is based on how a heli flips around: When a heli flips, it flips around its centre of gravity, which will be close enough to the main mast to say it is _on_ the main mast. The line is really an imaginary line between CG and the rotor hub but like I said, if CG is on the mast, then that imaginary line will be where the mast is.
When programming, this doesn't make a lot of difference. It's just an extra translation.
Kippesoep is offline                         Send a private message to Kippesoep
Reply With Quote
Old 13-10-2010, 03:53 PM   #7
Mighty Midget
Pox Vobiscum
 
Mighty Midget's Avatar


 
Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
Default

I see your point about ambiguosity. What's your thoughts on this:

Define a horizontal plane that doesn't rotate with a horizontal subvector. That vactor will decrease/increase in length and point in different directions as the mast tilts but crucially, it will be on a constant plane. One feature that can be implemented is to let the user define the "altitude" of the horizontal plane relatively to eyesight, and he can then practice orientations "in all altitudes".

The reason I'm a bit cautious about having the disc there (not to mention the full model) is that it is visual "noise", one of the many reasons orientation is so hard to learn.
__________________
Je Suis Charlie

Last edited by Mighty Midget; 13-10-2010 at 04:07 PM.
Mighty Midget is offline                         Send a private message to Mighty Midget
Reply With Quote
Old 14-10-2010, 01:06 PM   #8
Kippesoep
Forum hobbit
 
Kippesoep's Avatar


 
Join Date: Nov 2007
Location: Etten, Netherlands
Posts: 34
Default

Quote:
Originally Posted by Mighty Midget View Post
Define a horizontal plane that doesn't rotate with a horizontal subvector. That vactor will decrease/increase in length and point in different directions as the mast tilts but crucially, it will be on a constant plane. One feature that can be implemented is to let the user define the "altitude" of the horizontal plane relatively to eyesight, and he can then practice orientations "in all altitudes".

The reason I'm a bit cautious about having the disc there (not to mention the full model) is that it is visual "noise", one of the many reasons orientation is so hard to learn.
I'm having some trouble visualising your suggestion. Perhaps you should draw a picture too

Personally, I think the image I posted isn't very noisy, as it doesn't have any superfluous info -- every element serves a necessary purpose, but I can only speak for myself
Kippesoep is offline                         Send a private message to Kippesoep
Reply With Quote
Old 14-10-2010, 06:04 PM   #9
Mighty Midget
Pox Vobiscum
 
Mighty Midget's Avatar


 
Join Date: Mar 2006
Location: Krakeroy, Norway
Posts: 3,014
Default

Ok, cutting through all the blah blah about a small "revelation" I had today and getting straight to the point:

We'd need to define a horizontal plane in a way that suggests both dimensions in a 2 dimensional plane. We also need to define a vertical _axis_.

We're already familiar with such a model This very planet! Think:

Two opposite poles define the vertical axis, equator defines a plane _perpendicular_ to that axis!

Let Equator be a circle in isometric view. Draw an axis through the centre of the Equatorial circle.

The point where the axis and plane meet, will be the fixed point for our line.

Now for the actual visuals:

An isometric Equator and points indicating the poles. Then have one curved line from pole to pole. This line can then be moved to any position on the Equatorial line. On that n-s line, a compass rose that connects to the centre of the globe by a line (mast) that shows the _bearing_ (nose is always at 0 deg, tail always at 180 deg regardless of where north or south is). This compass rose can then be moves on that curved line. Where that line hits the isometric Equatorial line, that's the longitude. Key is, the n-s line only crosses Equator at ONE point. No ambiguity about the longitude.

When the user cross-references the intersection on the n-s line and equator, with the line going from "centre of earth" to the compass rose, a 3 dimensional understanding should be possible, I believe.

For the rotation around the mast, that would be the rotation of the compass rose. Since it is a bearing compass, the n-s line would then give the pilot direct visual clues where to push the sticks to move to either of the poles.

In short:

An isometric Equator

Two points marking the poles

A curved line going halfway around the globe starting/ending at the poles that can be rotated west/eastwards

A bearing compass that slides on the n-s line

A line from the centre of the globe to the compass rose

Finally, one crucial bit about moving the compass rose with the sticks.

When the right stick is pushed forward, the compass rose will move in the bearing= 0 deg direction, that is, push the stick forward, and the rose will move where 0 deg is pointing. Stick backwards and the rose will move where the 180 deg marker points. Left stick moves it towards the 270 deg marker and right stick towards the 90 deg marker.

Left stick left/right rotates the rose CCW/CW.
__________________
Je Suis Charlie

Last edited by Mighty Midget; 14-10-2010 at 06:13 PM.
Mighty Midget is offline                         Send a private message to Mighty Midget
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Pocket Pc's The Niles Programming 1 11-02-2006 05:11 AM
Programming In Windows. chickenman Tech Corner 15 10-10-2005 04:53 PM
Programming In Linux chickenman Tech Corner 6 01-10-2005 10:53 AM
Programming ultranewbie Old Suggestions 2 20-01-2005 09:22 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 03:21 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.