Skip to main content

The Future of Web Development: Why Next.js is Going Viral

  Are you ready to level up your web development game? Look no further than Next.js, the latest sensation in the world of web development that's taking the industry by storm. With its powerful features, flexibility, and performance optimizations, Next.js is becoming the go-to framework for building modern web applications. In this blog post, we'll explore why Next.js is going viral and how it's changing the landscape of web development. Supercharged Performance: One of the main reasons why Next.js is making waves is its superior performance capabilities. With built-in optimizations like automatic static site generation (SSG) and server-side rendering (SSR), Next.js allows you to create blazing-fast web applications that load quickly and deliver seamless user experiences. This is especially important in today's fast-paced digital world, where users demand instant gratification and have little patience for slow-loading websites. Flexibility and Scalability: Next.js provid...

Drawing coordinates system axes in corner of screen

Drawing coordinates system axes in corner of screen


void CDEMView::DrawSomeBox()
{
	// Define the needed matrices - object world, view and project 
	D3DXMATRIX matObjectWorld;
        D3DXMatrixIdentity (&matObjectWorld);	// object world matrix
	D3DXMATRIX matView;				
        D3DXMatrixIdentity (&matView);		// view matrix
	D3DXMATRIX matProjection;	
        D3DXMatrixIdentity (&matProjection);	// projection matrix
	
	// Get the needed matrices
	_device->GetTransform(D3DTS_VIEW, &matView);
	_device->GetTransform(D3DTS_PROJECTION, &matProjection);

	// Get the viewport
	D3DVIEWPORT9 viewport;
	_device->GetViewport(&viewport);

	// Get the center point of the object		
	D3DXVECTOR3* p_centerPoint = BoxCenterVector; // this is from an external variable

	// Get the point on the creen that is the screen projection of the object
	D3DXVECTOR3 projectPoint;
	D3DXVec3Project(&projectPoint, p_centerPoint ,&viewport, &matProjection, &matView, &matObjectWorld);

	// choose the screen point where the object is to be drawn, relative to the Viewport's dimensions
	D3DXVECTOR3 screenPoint;
	screenPoint.x = 0.1*viewport.Width;	// x position (horizontal) is 10% of the width of the screen (0% is left, 100% is right)
	screenPoint.y = 0.9*viewport.Height;	// y position (vertical) is 90% of the height of the screen (0% is top, 100% is bottom)
	screenPoint.z = projectPoint.z;		// 1-projectPoint.z*60/(-zoom);

	//transform the screen position to a world position
	D3DXVECTOR3 worldPoint;
	D3DXVec3Unproject( &worldPoint, &screenPoint, &viewport, &matProjection, &matView, &matObjectWorld );

	// now define how much to translate the box in order to get it to the point we want it to be (WorldPoint)
	float transX, transY, transZ;
	transX = worldPoint.x;
	transY = worldPoint.y;
	transZ = worldPoint.z;
	
	// define a mesh to store the object into and create the object
	ID3DXMesh* _SomeBox;
	float boxSize = 2.0f;
	D3DXCreateBox(_device,boxSize,boxSize,boxSize,&_SomeBox,NULL);

	// define a material and set its color
	D3DMATERIAL9 mat;

	// Set the RGBA for diffuse reflection.
	mat.Diffuse.r = 255;
	mat.Diffuse.g = 0;
	mat.Diffuse.b = 0;
	mat.Diffuse.a = 0.5;

	_device->SetMaterial(&mat);
	_device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); // D3DFILL_SOLID

	// apply the translation matrix
	D3DXMatrixTranslation(&matObjectWorld, transX, transY, transZ);
	_device->SetTransform(D3DTS_WORLD, &matObjectWorld);

	// draw the object
	_SomeBox->DrawSubset(0);
	// release the mesh
	_SomeBox->Release();

	// some debugging variables
	debug1 = transX;
	debug2 = transY;
	debug3 = transZ;
	debug4 = boxSize;
	//debug5 = scaleFactor;
	manole = 0;
}

Comments

Popular posts from this blog

The Future of Web Development: Why Next.js is Going Viral

  Are you ready to level up your web development game? Look no further than Next.js, the latest sensation in the world of web development that's taking the industry by storm. With its powerful features, flexibility, and performance optimizations, Next.js is becoming the go-to framework for building modern web applications. In this blog post, we'll explore why Next.js is going viral and how it's changing the landscape of web development. Supercharged Performance: One of the main reasons why Next.js is making waves is its superior performance capabilities. With built-in optimizations like automatic static site generation (SSG) and server-side rendering (SSR), Next.js allows you to create blazing-fast web applications that load quickly and deliver seamless user experiences. This is especially important in today's fast-paced digital world, where users demand instant gratification and have little patience for slow-loading websites. Flexibility and Scalability: Next.js provid...

Importants Links of Leetcode

  Here are all the important discussion posts which contain brief descriptions about a topic with its problem list. Recursion:- A.   https://leetcode.com/tag/recursion/discuss/1733447/Become-Master-In-Recursion Binary Tree and Binary Search Tree:- A.   https://leetcode.com/tag/binary-tree/discuss/1212004/Binary-Trees-study-guide B.   https://leetcode.com/tag/binary-tree/discuss/1820334/Become-Master-in-Tree C.   https://leetcode.com/tag/binary-tree/discuss/1094690/Views-and-Traversal-of-binary-tree-or-Important-topics-or-Must-Read-%3A- ) Dynamic Programming:- A.   https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns B.   https://leetcode.com/tag/dynamic-programming/discuss/1437879/Dynamic-Programming-Patterns C.   https://leetcode.com/tag/dynamic-programming/discuss/662866/DP-for-Beginners-Problems-or-Patterns-or-Sample-Solutions D.   https://leetcode.com/tag/dynamic-programming/discuss/1050391/Must-do-Dynamic-programm...

The Ultimate Guide: How to Become a Tech YouTuber

 The Ultimate Guide: How to Become a Tech YouTuber Are you passionate about technology and want to share your knowledge with others? Becoming a tech YouTuber can be a rewarding and exciting venture that allows you to create content about your favorite gadgets, software, and tech-related topics. With millions of viewers and subscribers on YouTube, the potential for success is immense. However, starting a tech YouTube channel requires careful planning, creativity, and dedication. In this blog, we will provide you with the ultimate guide on how to become a tech YouTuber. Identify Your Niche: Technology is a broad field, and it's essential to identify your specific niche before starting your YouTube channel. Consider what aspects of technology you are most passionate about and have expertise in. It could be smartphone reviews, software tutorials, gaming, programming, or any other tech-related topic. Choosing a specific niche will help you target a particular audience and create content...