Skip to content

Instantly share code, notes, and snippets.

View LoadDragon0000000000's full-sized avatar

LoadDragon0000000000

View GitHub Profile
float3 L = vLightDir; // ライトベクトル
float3 N = Normal; // 法線ベクトル
Out.Color = BaseColor + min(0.40f , BaseLight + max(0.0f, dot(N, L)));
// ----------------------------------------------------------------
// 拡散光
// シェーダはモデルに対して適用する
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// アプリケーション側で設定する変数
// ----------------------------------------------------------------
float4x4 mWVP; // ローカル-ワールド-ビュー-射影まで
void Shader::SuperRender_Lambert_Lock(Geometry& pThing, float X, float Y, float Z) {
// ワールドトランスフォーム
D3DXMatrixTranslation(&pThing.matWorld, X, Y, Z);
pDevice->SetTransform(D3DTS_WORLD, &pThing.matWorld);
ViewTrans(); // ビュー, プロジェクショントランスフォーム
m_pEffect->SetTechnique(m_hTechnique);
#include <stdio.h>
int main()
{
int number = 100;
printf("%d", &number);
return 0;
}
#include <stdio.h>
int main()
{
int number = 100; // 実際に扱うデータ
int* numberP = &number; // ポインタ変数にnumberのアドレスを代入
printf("%d \n", numberP); // numberのアドレスを表示
printf("%d \n", *numberP); // numberの中身を表示
}
#include <stdio.h>
void func(int* n) { // 変数のアドレスを受け取るという意味
*n = 333; // 受け取ったアドレスの中身(*n)に333を入れる
}
int main()
{
int number = 100; // 実際に扱うデータ
// ------------------------------------------------------------------------
// 金属反射
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// グローバル変数
// ------------------------------------------------------------------------
float4x4 mWVP; // ローカル→射影まで変換する
// 視点位置を確定
g_position = ::Effekseer::Vector3D(0.0f, 0.50f, 15.0f);
MessageBox(NULL, "g_poscamera", "DEBUG", MB_OK);
// 投影行列を設定
g_renderer->SetProjectionMatrix(
::Effekseer::Matrix44().PerspectiveFovLH(90.0f / 180.0f * 3.14f, (float)1920 / (float)1080, 1.0f, 100.0f));
MessageBox(NULL, "g_perspective", "DEBUG", MB_OK);
#include <iostream>
#include <fstream>
#include <ios>
#include <iomanip>
#pragma warning(disable:4996)
using namespace std;
const int DECK_NUM = 40; // デッキの総枚数
int main() {
#include "DxLib.h"
#include <math.h>
const float DEGTORAD = 0.017453293f; // 度数表記をラジアンに変換する定数
int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) {
// ---ここから設定---
ChangeWindowMode(TRUE), SetMainWindowText("斜め方向に移動する玉"), SetGraphMode(640, 480, 32),
SetDoubleStartValidFlag(TRUE); DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK);
// ---ここまで設定---