Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 原始碼修改{ class Program { static void Main(string[] args) { Menu.ShowIntroduce(); Command command ; while
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO ;namespace 指令碼產生程式{ public class HandlerAFile { private StreamReader reader; private StreamWriter writer; private string fileName; private string
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO ;namespace 指令碼產生程式{ static public class ProcessASourceFile { static private bool IsSpaceChar(char c) { return c == ' ' || c == '\t'; } static
Time of Update: 2018-12-04
#include "Camera.h"#include <d3dx9math.h>//初始情況下將攝像機放置在同全局座標軸重合Camera ::Camera(float fov, float viewPortWidth, float viewPortHeight){position.x = 0 ;position.y = 0 ;position.z = 0 ;direction.x = 0 ;direction.y = 0 ;direction.z = 0 ;this
Time of Update: 2018-12-04
#ifndef MATH_H_#define MATH_H_#include <math.h>#define PI (3.141592654f)#define RADIAN_TO_DEGREE(r) ((r) * 180.0f / PI)//弧度到角度#define DEGREE_TO_RADIAN(a) ((a) * PI / 180.0f)//角度到弧度//4D向量(齊次座標)struct Vector4{union{float M[4] ;struct{float x
Time of Update: 2018-12-04
#include "Math.h"#include "Camera.h"Cube ::Cube(float x, float y, float z){vertexCount = 8 ;polyCount = 12 ;position.x = x ;position.y = y ;position.z = z ;float scaler = 0.2 ;localVertices[0].x = -50 * scaler ;localVertices[0].y = 50 * scaler
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 原始碼修改{ public abstract class IOperateDocument { private string separatingString; public string SeparatingString { get
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using System.Text;namespace 原始碼修改{ public class ReadDocument : IOperateDocument { private FileInfo documentFileInfo; private StreamReader reader; //
Time of Update: 2018-12-04
#include "stdafx.h"#include <math.h>#include <assert.h>#include "Common.h"#include "EularAngles.h"#include "Quaternion.h"#include "Matrix4x4.h"EulerAngles ::EulerAngles(){}EulerAngles ::EulerAngles(float heading, float pitch, float bank):
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using System.Text;namespace 原始碼修改{ // 將字串寫入文檔 public class WriteDocument : IOperateDocument { private StreamWriter writer; private Dictionary<int, string>
Time of Update: 2018-12-04
四元數,之前完全不知道是怎麼一回事的東西,最近幾天突擊學習了下.同歐拉角,矩陣相聯絡的學習,寫了這麼一個東西.先放著吧,把3D數學這塊學得差不多再考慮是不是要整合到我的線框引擎中,實現一個嚴謹的數學庫還是相當難的啊.通常操作的都是單位四元數,因為這樣的話n是單位向量,就如同單位向量在計算中帶來的便捷那樣.四元數跟向量是息息相關的,兩個四元數點乘可以得出相似性,也就是可以求出夾角,並且通過求t次冪,可以求出四元數的分量.並且這東西可以平滑插值,還可以串連多個旋轉.真是非常好的工具,學了才知道這些.
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using Common;namespace 指令碼產生程式{ static public class ProcessAResultFile { static private void WriteConstantString(StreamWriter writer, string str) {
Time of Update: 2018-12-04
//Camera.h#ifndef CAMERA_H_#define CAMERA_H_#include "Math.h"class Camera{private:Vector3 direction ;//朝向float aspectRatio ;//寬高比public:Vector3 position ;//位置//根據視距和水平視域,寬高比,來確定的近裁剪面尺寸float nearLeft ;float nearRight ;float nearBottom ;float nearTop ;
Time of Update: 2018-12-04
#include <assert.h>#include "Quaternion.h"#include "Matrix4x4.h"void Quaternion ::Indentity(){w = 1 ;x = y = z = 0 ;}void Quaternion ::SetToRotateAboutX(float theta){float thetaOver2 = theta / 2 ;w = cos(thetaOver2) ;x = sin(thetaOver2) ;y = 0
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using System.Text;namespace 原始碼修改{ // 讀出關鍵字符串到目的文件 // 過濾重複字串 public class ReadSourceFile : IOperateSource { WriteDocument writeDocument; public
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using System.Text;namespace 原始碼修改{ public class WriteSourceFile : IOperateSource { private ReadDocument readDocument; private List<string> sourceFileContent;
Time of Update: 2018-12-04
又是一道動態規劃的題,真的類似於0-1背包問題.在提示之下解決了,總算是解決了.雖然沒費多少勁. 這個東西,沒有用物件導向的方式寫.體驗了一把,結構化.對於參數傳遞,共用資料,的確不及類方便. 這種問題的狀態轉移方程,沒有寫對.我找錯了狀態.這段時間看<<代碼大全>>,感覺自己的代碼風格有所好轉.雖然覺得過去的也不錯,但是也沒有現在的好. 再說下問題的實質吧:給定硬幣的面值集合與總錢數,給出最少硬幣數的找錢組合.
Time of Update: 2018-12-04
using System;using System.Collections.Generic;namespace 原始碼修改{ public enum Command { R, W, C, H, Q, WrongCommand } static public class Menu { static private string introduce =
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.IO;using System.Text;namespace 原始碼修改{ // 遍曆程式目前的目錄下所有.cs檔案 public class TravelAllFiles { private DirectoryInfo rootDirectory = new
Time of Update: 2018-12-04
using UnityEngine;using System.Collections;// 王民光是他的祖父public class WangShaoWen : MonoBehaviour{ void Start() { } void Update() { } public void Report(string content) { Debug.Log(content + " at WangShaoWen !");