Waitrud Weber’s blog

things and reminders for memories

3d: WindowsAPI: Windows-make: Photons:

20200222: Local axis, Photon calculation needs.

// Qualified:
// Have a Look: 20200223:
// Compiled : 20200223:
// 
//
void vCircle::calculation_local_axis( vPoint set_up, vPoint right_x, vPoint *local_x_axis,  vPoint *local_y_axis, vPoint *local_z_axis) {
	vPoint* next = nullptr;
	vPoint* base_xaxis = nullptr;
	vPoint* up = nullptr;
	vPoint* depth = nullptr;
	vPoint* right = nullptr;
	vPoint* start = nullptr;
	vCalculation* calc = nullptr;

	vPoint* Depth = nullptr;
	// set memory indxex.

	this->max_pixel = 5;
	calc = new vCalculation ();

	depth = memorizevPoint( 0.0f, 0.0f, 0.0f);
	right = memorizevPoint( 0.0f, 0.0f, 0.0f);
	up = &set_up;
	base_xaxis = &right_x;
	calc->cross( up , base_xaxis, depth );
	calc->cross( depth , up, right );
	calc->normal( up );
	calc->normal( right );
	calc->normal( depth );

	local_y_axis = up;
	local_x_axis = right;
	local_x_axis = depth;
}

20200222: Local axis, Photon calculation needs.

// Qualified : 
//
//
//
//
void vCircle::calculation( vPoint set_up, vPoint right_x ) {

	vPoint* next = nullptr;
	vPoint* base_xaxis = nullptr;
	vPoint* up = nullptr;
	vPoint* depth = nullptr;
	vPoint* right = nullptr;
	vPoint* start = nullptr;
	vCalculation* calc = nullptr;

	vPoint* Depth = nullptr;

	float PI = 3.141592f;
	float exact_length = this->R*PI;
	float length = 0.0f;
	const float c_length = 5.0f;

	// set memory indxex.

	this->max_pixel = 5;
	calc = new vCalculation ();

	depth = memorizevPoint( 0.0f, 0.0f, 0.0f);
	right = memorizevPoint( 0.0f, 0.0f, 0.0f);
	up = &set_up;
	base_xaxis = &right_x;
	calc->cross( up , base_xaxis, depth );
	calc->cross( depth , up, right );
	calc->normal( up );
	calc->normal( right );
	calc->normal( depth );

	start = memorizevPoint( 0.0f, 0.0f, 0.0f);
	put_memories( start ); // Book memory-administration.
	calc->scale( depth, this->R, start ); 

	// malloc
	this->pixels = (vPoint**) malloc( sizeof(vPoint*) * this->max_pixel );
	for ( int i=0; imax_pixel; i++ ) {

		printf("001: i=%d / %d \r\n", i, this->max_pixel );

		if ( i >= this->max_pixel ) {
			//realloc
			this->pixels = (vPoint**) realloc( this->pixels, sizeof(vPoint*) * this->max_pixel );
			this->max_pixel *= 2;
		}
		this->pixels[i] = memorizevPoint( 0.0f, 0.0f, 0.0f);

		printf("002: i=%d / %d \r\n", i, this->max_pixel );

		// 20191124 debug
		calc->Print_Point_Memories();
		printf("this->Center %p\r\n", this->Center);

		printf("Depth: %p up %p next %p \r\n", Depth , up, next);

		// calculation of next.
		Depth = calc->subtract( start, this->Center );
		printf("Depth: %p up %p next %p \r\n", Depth , up, next);

		printf("003: i=%d / %d \r\n", i, this->max_pixel );

		calc->Print_Point_Memories();

		next = memorizevPoint( 0.0f, 0.0f, 0.0f);
		put_memories( next ); // Book memory-administration.
		printf("Depth: %p dpeth %p up %p next %p \r\n", Depth, depth , up, next);

		calc->cross( Depth, up, next);
		// 20191124 debug

		printf("004: i=%d / %d \r\n", i, this->max_pixel );
		calc->normal( next );
		next = calc->scalize ( next, c_length ); // specialized.
		printf("005: i=%d / %d \r\n", i, this->max_pixel );

		// revisement
		vPoint* revisement = calc->add( start, next );
		revisement = calc->subtract( revisement, this->Center );
		calc->normal( revisement );
		revisement = calc->scalize( revisement, this->R );
		revisement = calc->add( this->Center, revisement );

		printf("revisement: %p ", revisement);
		revisement->print();

		// 20191126
//		this->pixels[i] = (vPoint*) next;
		this->pixels[i] = (vPoint*) revisement;

		// finish the next calculation.
		length += c_length;
		if ( length > exact_length ) { 
			index_pixel =i;
			break;
		}

	}

	// flush memories to last indxex.

	printf( "max_pixel= %d index_pixel=%d \r\n", this->max_pixel, this->index_pixel );

	printf(" vCircle::calculation ends\r\n");
}

20200221

wButtonController::Process: 0 / 15<-WM_PAINT wParam 117508109 lParam 0 this->event->uMsg:2685472 *(this->event->uMsg)=0

wButtonController::WM_PAINT:
this->event->main_mode = 2
default:
void wButtonController::drawButtons ( HDC hdc ): Starts
AryButton 0 = 0
AryButton 1 = 0
AryButton 2 = 1
AryButton 3 = 0
AryButton 4 = 0
AryButton 5 = 0
AryButton 6 = 0
AryButton 7 = 0
AryButton 8 = 0
void wButtonController::drawButtons ( HDC hdc ): Ends
wmpaint_display_threeD_proc_002:
memorized_CurveLines=0
memorized_CurveLines=0
WM_MESSG 004: 15 *(p_evt->uMsg):1997380648 uMsg:15 p_evt->uMsg: 2685472 &uMsg: 2686020
WM_PAINT 005: 15 *(p_evt->uMsg):1997380648 uMsg: 15
WM_PAINT 006: 15 *(p_evt->uMsg):1997380648 uMsg: 15
WM_MESSG 000: hWnd 263346: uMsg 257: wParam 13: lParam -1071906815: canvas 4370832: btc 4370848: *(p_evt->uMsg) 257:
WM_MESSG 003: 257 *(p_evt->uMsg):257
wButtonController::Process: 257 / 15<-WM_PAINT wParam 13 lParam -1071906815 this->event->uMsg:2686208 *(this->event->uMs
g)=257
wButtonController::ProcessWmKeyup: Starts:wButtonController::initialize 2
display_threeD_screen_initialize_002 starts
this->eye= p( 500.000000, 500.000000, -500.000000)
lookat= p( 0.000000, 0.000000, 0.000000)
n_howfar= p( -0.577350, -0.577350, 0.577350)
howfar= p( -184.752075, -184.752075, 184.752075)
up= p( 0.000000, 1.000000, 0.000000)
u= p( 0.707107, -0.000000, 0.707107)
U= p( 452.548340, -0.000000, 452.548340)
V= p( -195.959167, 391.918335, 195.959167)
aReuse: 3/8
#include 

#include "vPoint.h"
#include "vPhoton.h"

vPhoton::vPhoton ( ) {

	this->photon1 = new vPoint();
	this->photon2 = new vPoint();
	this->c1 = (char*)" ";
	this->c2 = (char*)" ";
}

//
//
//
//
//
void vPhoton::setNormal(vPoint* normal)
{
	this->photon2 = normal;
}

//
//
//
//
//
void vPhoton::setPlace(vPoint* place)
{
	this->photon1 = place;
}

//
//
//
//
//
void vPhoton::print () {
	if ( this->photon1 == nullptr || this->photon1 == nullptr) {
		return;
	}

	printf("vPhoton: %p %p\r\n", this->c1, this->c2);

	this->photon1->print();
	this->photon2->print();
}
#ifndef _VPHOTON_H_
#define _VPHOTON_H_
class vPhoton {
	public :
		vPoint *photon1, *photon2; // Place amd Normal, which is Refrection on the face.
		char *c1, *c2;

	public:
		vPhoton ();
		void setPlace(vPoint* place);
		void setNormal(vPoint* normal);
		void print () ;

};

#endif