可点击的粒子宇宙

时间:2016-08-12 02:04:14

标签: javascript 3d three.js particles universe

我试图创建一个消息世界。 这些将存储在 mongoDB 中,因此您可以单击任何粒子并阅读该消息。

现在,我不知道如何获得点击的粒子。我尝试过交叉路口,但我确定我在某个地方犯了错误。

这里是CodePen :: http://codepen.io/Mr-K/pen/JKZPWK

粒子宇宙几乎已经完成了。 这里有添加粒子:

// USED TO RETRIEVE THE FILENAME IN A OPENFILEDIALOG
public static string GetFile() {
    MyLog.Write(@"Begin OpenFileDialog Process", LogFormat.Evaluate);
    var path = _lastFilePath != string.Empty ? _lastFilePath : GetBaseDirectory();
    if (path == null || !Directory.Exists(path))
        path = Assembly.GetExecutingAssembly().CodeBase;

    var dialog = new OpenFileDialog {
        InitialDirectory = path,
        Filter = @"Text|*.txt|All|*.*",
        RestoreDirectory = true
    };

    var result = DialogResult.Retry;
    while (result == DialogResult.Retry) {
        if (dialog.ShowDialog() != DialogResult.OK) {
            MyLog.Write(@"File Retrieval was Unsuccessful", LogFormat.Result);
            MyLog.Write("No File Selected", LogFormat.Error);
            result = MessageBox.Show(@"Please select a file..", @"No File Selected!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
            if (result == DialogResult.Abort || result == DialogResult.Cancel) { break; }
            if (result == DialogResult.Retry) { return GetFile(); }
        }

        MyLog.Write($"FilePath: {dialog.FileName}", LogFormat.Process);
        MyLog.Write(@"File Retrieval was Successful", LogFormat.Result);
        _lastFilePath = Path.GetDirectoryName(dialog.FileName);
        return dialog.FileName;
    }
    return null;
}

}

如何点击粒子并显示警告或其他内容,只需使用前面描述的数组激活一个函数,弹出消息和particleCount。

由于

0 个答案:

没有答案
相关问题