DirectX.Direct3D Rotation And Textures?

Mar 12, 2011

SI like doing random things like 3D objects inside a windows form. With that said, I'm creating an application that will, eventually, write the code for me, after I do it myself visually.If you run the app it will make some more sense I guess.Now, to rotate the cubes, I'm using

.Transform.World = Matrix.RotationYawPitchRoll(CSng(CubeRx(1) / 10), CSng(-CubeRy(1) / 10), CSng(CubeRz(1) / 10))

now I do not want the world to rotate, just my individual cubes.Here's an example of me referring to my cube in action

If howmanycubes >= 1 Then
' vb2 = New VertexBuffer(GetType(CustomVertex.PositionNormalColored), 36, d, Usage.Dynamic And Usage.WriteOnly, CustomVertex.PositionColored.Format, Pool.Default)

[code]....

how to apply textures to the cube.instructions:When running the program, type in values on right side and click create cube.before you click create cube again, those same text boxes will adjust your current cube.Then when you click create new, it places another cube ontop of your current cube, so you'll need to give it new values.Not much validation is going on so some bad values will cause crashes.

View 1 Replies


ADVERTISEMENT

.net - Casting From Int32 To 'Microsoft.DirectX.Direct3D.VertexShader'?

Mar 4, 2010

How to solved error Unable to cast object of type 'System.Int32' to type 'Microsoft.DirectX.Direct3D.VertexShader'

We want to case ''System.Int32' value into 'Microsoft.DirectX.Direct3D.VertexShader'
I tried with CType but not working.Also tried mD3DDevice.VertexShader = CObj(D3DFVF_CUSTOMVERTEX_BOX)

View 1 Replies

Windows 7 Can't Find DirectX9 Microsoft.DirectX.Direct3D.dll?

Apr 9, 2009

this error seems to be an error on Microsoft's part with Windows 7 and DirectX9. DirectX11 on Windows 7 should be able to run DirectX9, but it says it can't find the assembly called "Microsoft.DirectX.Direct3D.dll". I know for a fact that he can play Assasins Creed on Windows 7 which uses DirectX9.. Why does that game work but not my application? I'm using VB.NET btw.

[Code].....

View 6 Replies

Excel - Code In VBA And Recording A Macro - Input A Values For The X Axis Rotation And The Y Axis Rotation

Sep 16, 2009

I am having some major problems with the code in VBA and recording a macro didn't get me anywhere nor is the VBA help file. I have to have it so that I can input a values for the x axis rotation and the y axis rotation so that my 3d surface graph will rotate whatever values I input, the 3d surface graph will rotate those degrees. I also have to have a method for having the default rotation. I was also wondering how to put scroll bars for the x and y rotation. The only other thing I am having trouble with is having an input to check box for right angle axes. So far I have two cells for entering the x rotation value and the y rotation value. I also already have my 3d surface graph.

View 3 Replies

Any Way To Blend Several Pictures (Textures) Together

Jul 4, 2009

I'm trying to blend a few textures together to "bake" the final texture. Since I need the actual resulting bitmap, I don't think I can/want to do this using DirectX or OpenGL. I have:
- 4 Textures (RGB, 2048x2048): t0, t1, t2, t3
- 3 Alphamaps (ARGB, the RGB value is irrelevant, 64x64): a1, a2, a3

Here's what I currently do for each pixel (in simplified notation):
FinalColor = ((t0 * (1 - a1) + t1 * a1) * (1 - a2) + t2 * a2) * (1 - a3) + t3 * a3

This works fine, however, it takes forever, because I have to iterate over a 2048x2048 image pixel by pixel. Is there a more elegant way to solve this (i.e. using graphics.drawimage or something like it, but then, how?) How can I scale to Alphamap up with bilinear/bicubic interpolation (without having to do it pixel by pixel)? I currently use the original resolution, but that leads to rather visible transitions.

View 19 Replies

How To Make TabControl With Different Textures And Sliding Look

Mar 19, 2011

I am making a TabControl with different textures and a sliding look. But I am having trouble with following points :-

1. How to make buttons click able at Design time, so as to switch to different tabPages [which are panels in this case]
2. How to add a property ex. TabPages() as Panel collection Editor [like TabPages Collection editor in case of TabControl]

I tried,
Public ReadOnly Property TabPages() As List(Of Panel)
Get
TabPages = p
ref()
End Get
End Property
Where p is another List of panel and ref() checks new addition of control in p -> adds it to UserControl.

3. How to get the upper-right corner arrow to quickly add a tab in Design mode.

View 6 Replies

Windows - Displaying Textures In OpenGL In XP Vs 7

Nov 12, 2010

I am running into the strangest problem that I just can't place my finger on. I've been developing an application in VB.net for the last couple months in Windows 7. The program involves some basic OpenGL drawing and animation with basic shapes (squares and circles) and basic textures mapped onto pointlists. The time has come to distribute the program to another machine. On some machines though, I encounter problems when I'm drawing textures. I know that openGL is still functional because drawing basic squares and circles still occur, the textured objects are the only things missing.

[Code]...

View 2 Replies

Allow The User To Add Locations For Direct3D Icons?

Jan 23, 2010

I'm making a scripter to allow the user to add locations for Direct3D Icons, but I'm trying to make a sub for it...

Public Sub icoadd(ByVal mod1 As String, ByVal mod2 As String)
loc.X = defined.Location.X
loc.Y = defined.Location.Y

[Code].....

View 4 Replies

Avoid The Direct3D Loaderlock Expectation?

Jul 13, 2009

OK, I've read everything I could find about this loader lock exception: DLL <name>.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

Just turning off the loader lock exception in the managaged debugging assistants doesn't work (my real application then hangs), and all the work-arounds are for doing things in C++ that I can't do in VB (like setting linker options). So, can anyone tell me how to make this simple blank form (with two additional lines of code in the constructor) avoid a loaderlock execption under VS2008? (If I know what to do to fix this toy example, I can probably fix my real app.)

[Code]...

View 10 Replies

Boolean Subtraction Of Two Meshes With Direct3D

Jun 20, 2009

i'm working on a simple 3D CAD to create complex 3D objects. This application uses:

1. Direct3D to render the objects
2.The methods contained in the Mesh class (such as Mesh.Box(...)) to create them
3.The Matrix class to apply some basic transformations (such as Translation or Rotation)

My issue is to do a boolean subtraction of a Mesh to another one to create a more complex Mesh, for example a Mesh with holes.

View 3 Replies

Direct3D / Windows Mobile - Lighting / Shading - Mesh Appears Flat?

Mar 20, 2010

Im currently working my way through understanding direct3D with visual basic for windows mobile. So far I have managed to write a fairly decent engine that allows me to create and transform any number of 3D primitives and 2D sprites. However I cant seem to figure out how to get Direct3D to apply any sort of shading to my meshes. Regardless of what angle they are to the camera, or their position in 3D space, they remain a solid flat color on every single polygon of the mesh.

[Code]...

View 3 Replies

Axis Of Rotation In Vb?

Jan 29, 2011

I have created some 3d models(VB) for display in a WPF 3d Viewport and would like to rotate them. I would like to rotate them about an axis of rotation defined by a line through two 3d points. All the examples seem to rotate about one of X Y or Z axes and are not helpful for a more general approach. The angle of rotation is easily found. My maths is a bit rusty now so is there a function that would calculate the axis easily ?

View 2 Replies

Bitmap Rotation Using GDI+

Dec 26, 2009

explain how Graphics.RotateTransform is working?

[Code]...

View 6 Replies

3D Object Rotation In 2008?

May 19, 2009

I'm developing a sun shading analysis tool, and part of the analysis involves rotating a house (modelled as a cube consisting of 8 points) by the solar azimuth and solar altitude angles. The reason for this is to determine if the wall in question is facing the sun, and if so I run a shading analysis using a scanline algorithm to determine the percentage of wall plane that is in shade from a tree in the yard (this is modeled using overlapping 2D polygons). The purpose of the rotation and tilt of the object is so that the wall plane is directly perpendicular to the sun, so that the analysis can be done in 2D as opposed to 3D.

I first rotate each point of the house (which is stored in an array) through the azimuth, and then tilt it up through the solar altitude angle. I have set up my 3D coordinate system using the standard right-hand rule for orientation of the x,y,z axes. I'm using a basic rotation matrix as follows:For the azimuth, I am rotating around the z-axis, so I am using the following matrix transformation.
[x',y'] = [x*cos(azimuth) - y*sin(azimuth) , x*sin(azimuth) + y cos(azimuth)]For the altitude, I am rotating the object about the x-axis to tilt it up. I use the initial z-coordinate and the transformed y'-coordinate for the altitude tilt calculation.Each point, when completely rotated and tilted, will have a distinct set of coordinates: [x', y'', z'].Individually, the rotation and tilt work fine. But when I try to do them consecutively, I run into problems.

View 4 Replies

Change Rotation Of A PDF Document?

May 3, 2012

I am first time working on PDF documents.I was searching on Rotation of a PDF page. I got some code samples regarding rotations by 90,180,270,360 degrees.

But my problem is that if there is a very small rotation required of the order of few degrees .. Is there any way that we can specify an angle using a slider bar or use the mouse to click and rotate the PDF page...

View 3 Replies

Does Not Keep Track Of The Actual Rotation

Apr 1, 2011

I have a screen full of puzzle peices they are all rotated at different angles (90,180,270). is there a way to track the peices rotation? I was thinking of using a 2d array to store there rotation. however, I am using this code to rotate the peices:

[Code]...

View 6 Replies

Get The Center Point Of A Rotation?

Jan 24, 2010

i'm developing a simple 2d animation program. my task is to get the center point of a rotation, for example: at the frame 0 there is a rectangle at x,y coordinates and with 0° of rotation at the frame 10 there is the same rectangle, translated and rotated what is the center point around which the rotation occurred? This is not really a question about programming, i know, rather than a problem of geometry.

View 1 Replies

Rotate Image Like 3d Rotation?

May 12, 2012

how to rotate image like 3d rotation?

View 2 Replies

C++ - Direction Of Shortest Rotation Between Two Vectors

Jun 13, 2012

my question is regarding working out the direction of the smallest angle between two vectors in 2D. I am making a game in C++ where one of the obstacles is a heat seeking missile launcher. I have it working by calculating the vector between the target and bullet, normalising the vector and then multiplying it by its speed. However, I am now coming back to this class to make it better. Instead of instantly locking onto the player I want it to only do so only when the bullets vector is within a certain angle (the angle between the bullets vector and the vector bulletloc->target). Otherwise I want it to slowly pan towards the target by a degrees thus giving the player enough space to avoid it. I have done all this (in a vb.net project so i could simplify the problem, work it out then re write in in C++). However the bullet always rotates clockwise towards the target even if the quickest route would be counter clockwise. So the problem is working out the direction to apply the rotation in so the smallest angle is covered. Here is my code so you can try and see what I am describing:

Function Rotate(ByVal a As Double, ByVal tp As Point, ByVal cp As Point, ByVal cv As Point)
'params a = angle, tp = target point, cp = current point, cv = current vector of bullet'

[Code]...

I had was to work out the bearing of the two vectors and if the difference is greater than 180 degrees, rotate clockwise otherwise rotate counter clockwise

View 1 Replies

Get Text Field Rotation With ITextSharp?

Jun 4, 2009

What I need to do is query an iTextSharp AcroField to check if it is rotated, and if so capture the value of the rotation.So If I have the following field:

Dim af As iTextSharp.text.pdf.AcroFields = stamper.AcroFields
Dim afi As iTextSharp.text.pdf.AcroFields.Item
afi = af.GetFieldItem("fieldName")

What do I need to do to get the rotation (in degrees) of that specific field?

View 1 Replies

Custom User Control Graphics Rotation?

May 31, 2010

I'm trying to build a dial control as a custom user control in VB.NET. I'm using VS2008.so far I have managed to rotate image using graphics.rotatetransform . however, this rotate everything. Now I have a Bitmap for the dial which should stay stable and another Bitmap for the needle which I need to rotate.so far i've tried this:

Dim gL As Graphics = Graphics.FromImage(bmpLongNeedle)
gL.TranslateTransform(bmpLongNeedle.Width / 2, bmpLongNeedle.Height * 0.74)
gL.RotateTransform(angleLongNeedle)[code].....

As I understand it, the image of the needle should be rotated at angle "angleLongNeedle" although i'm placing the rotated image at 0,0. However, the result is that the Needle doesn't get drawn on the control.

View 2 Replies

Extract Transform And Rotation Matrices From Homography?

Sep 12, 2011

I have 2 consecutive images from a camera and I want to estimate the change in camera pose:

I calculate the optical flow:

Const MAXFEATURES As Integer = 100
imgA = New Image(Of [Structure].Bgr, Byte)("pic1.bmp")
imgB = New Image(Of [Structure].Bgr, Byte)("pic2.bmp")
grayA = imgA.Convert(Of Gray, Byte)()

[Code]...

How do I calculate the new position and lookat?

If I'm doing this all wrong or if there's a better method,

View 1 Replies

Find Shift And Rotation Between Same Two Images Using Programming Languages C++ Or C#?

Sep 1, 2009

How to find shift and rotation between same two images using programming languages vb.net or C++ or C#?

View 5 Replies

Applying Both A Rotation And Color Adjustment To A GDI DeviceContext Causes The Colours To Be Reset?

Sep 1, 2011

I am using API calls to transform a Bitmap object. I have various physical transformations (rotation, flipping, scaling, displacement) as well as some colour adjustments (inversion, brightness and contrast)Everything works fine except for when I use the rotation or shear transformations in combination with the colour adjustment. In that case the colours revert to the original image.The interesting thing about this problem is that it seems to be dependent on the off-diagonal factors (eM12 and eM21 below) in the XForm matrix. For example, here is the rotation matrix:

Public Sub RotateClockwise(Radians As Single)
With XFormMatrix
.eM11 = Cos(Radians)[code]....

is there some way I can use both SetWorldTransform and SetColorAdjustment when using non-zero values for the off-diagonal factors in my XForm transformation?

View 1 Replies

Game Programming :: Screen Rotation Handling With Compact Framework

Oct 4, 2008

I am developing a game in compact framework. In Mobile Devices there is a button that Rotates the screen by 90 degrees so you can hold the mobile device the way that suits you. The problem is that i want to handle that in my game, so if i see that the screen has rotated the game will pause.

[Code]...

View 2 Replies

VS 2010 Way To Control Mouse Wheel Rotation With A Simple API / Without To Hook Mouse?

May 24, 2012

The GetAsyncKeyState Api does'nt recognizes the mouse wheel rotation, I see.Is there way to control the mouse wheel rotation (always, not only when the pointer is over a form of mine) with a simple API, without to Hook the mouse?

View 2 Replies

IDE :: Add The Directx In VB6?

Mar 9, 2009

i am using windows vista and i have installed visual basic 6 and Microsoft directx SDK 2008 in my computer.I want to use directx in VB6 but i am not able to add it from the reference.There is no reference to directx available there.

View 1 Replies

Set DirectX SDK Up With VB?

May 9, 2009

i am beginning to be better and better to VB express edition 2008, and really really like this language, my goal is to program 3D games.And since i didn't came anywhere in C++ or C#, i believe it's possible to make great 3D in Visual Basic. how to set DirectX SDK up with Visual Basic? and show me some tutorials or books?

View 10 Replies

Using DirectX With VB?

Jul 21, 2009

I have a quick question that needs answering. How can I use DirectX in my VB 2008 application? Most sites I've seen says to write Imports Microsoft.DirectX but it's apparently not there. I have downloaded the DirectX SDK (MArch 2009) but there are only C++ files in there. Can anyone provide insight as to how I could solve this?

View 5 Replies

VS 2010 Object Rotation And Move Object With Arrow Keys?

Feb 8, 2011

I want to learn how to rotate an object by direction and speed and also how to move an object using the arrow keys?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved