3D challenge for a special rotation
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
3D challenge for a special rotation
Purpose of a 3D challenge.
Just get the executeable (put first the 'Engine3D.dll' in the system directory or in the same dir than the executeable)
After run it, you can see an object (Entity) which can be rotated using mouse movements, and the rotation of the entity is such that it rotates in the same direction as the mouse movements.
Now, while pushing left-control key and moving mouse, the camera orbitates around the object in the world.
Again, pop the left-control key and you can see ALWAYS the object rotates in the same direction as the mouse movements, nevertheless the camera looking vector is.
The issue seems trivial. So, I don't give you any code, just try to do with your own code; will see the triviality of it
By the way, I have not seen any 3D CAD-CAM program which do that: at least Catia, Solidworks, Inventor, Cinema4D, Blender, Rhinoceros, Sketchup, AutoCAD do not it. Why? I don't know.
windows 32bit : https://www.dropbox.com/s/hels4zqy29y16 ... tation.exe
windows 64bit : https://www.dropbox.com/s/55ru9ynhm9376 ... nwin64.exe
Just get the executeable (put first the 'Engine3D.dll' in the system directory or in the same dir than the executeable)
After run it, you can see an object (Entity) which can be rotated using mouse movements, and the rotation of the entity is such that it rotates in the same direction as the mouse movements.
Now, while pushing left-control key and moving mouse, the camera orbitates around the object in the world.
Again, pop the left-control key and you can see ALWAYS the object rotates in the same direction as the mouse movements, nevertheless the camera looking vector is.
The issue seems trivial. So, I don't give you any code, just try to do with your own code; will see the triviality of it
By the way, I have not seen any 3D CAD-CAM program which do that: at least Catia, Solidworks, Inventor, Cinema4D, Blender, Rhinoceros, Sketchup, AutoCAD do not it. Why? I don't know.
windows 32bit : https://www.dropbox.com/s/hels4zqy29y16 ... tation.exe
windows 64bit : https://www.dropbox.com/s/55ru9ynhm9376 ... nwin64.exe
Last edited by Psychophanta on Mon Mar 11, 2019 8:37 pm, edited 1 time in total.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: 3D challenge for a special rotation
Just for the fun of it, my very first 3D code, cobbled together from the samples.Educational, to say the least; but most of all, fun!
Code: Select all
Define keyX.f, mouseX.f, wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered,
keys$ = "Mouse & Left/Right Arrows to move - Spacebar to stop - ESC to quit"
If InitEngine3D() And InitSprite() And InitKeyboard() And InitMouse() And
OpenWindow(0, 0, 0, 800, 600, "3D Challenge - " + keys$, wFlags) And
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
KeyboardMode(#PB_Keyboard_International)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Packs/desert.zip", #PB_3DArchive_Zip)
CreateSphere(0, 9)
CreateMaterial(0, TextureID(LoadTexture(#PB_Any, "glass.png")))
CreateEntity(0, MeshID(0), MaterialID(0), 0, 0, -10)
CreateLight(0, RGB(150, 200, 200), 200, 200, 200)
AmbientColor(RGB(220, 30, 30))
SkyBox("desert07.jpg")
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0, 50, #PB_Absolute)
Repeat
Repeat
event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
appQuit = 1
EndSelect
Until event = 0
If ExamineMouse()
lastMouseX = mouseX
mouseX = -MouseDeltaX() * 0.5 * 0.05
If mouseX <> lastMouseX
keyX = 0
MoveCamera(0, mouseX, 0, 0)
RotateCamera(0, 0, mouseX, 0, #PB_Relative)
EndIf
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
keyX = -0.5
ElseIf KeyboardPushed(#PB_Key_Right)
keyX = 0.5
ElseIf KeyboardPushed(#PB_Key_Space)
keyX = 0
ElseIf KeyboardPushed(#PB_Key_Escape)
appQuit = 1
EndIf
MoveCamera(0, keyX, 0, 0)
RotateCamera(0, 0, keyX, 0, #PB_Relative)
EndIf
RenderWorld()
FlipBuffers()
Until appQuit
EndIf
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: 3D challenge for a special rotation
Welcome to 3D world !
Walk more inside and then will see 3D programming is not much to do with other programming.
Walk more inside and then will see 3D programming is not much to do with other programming.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: 3D challenge for a special rotation
Very true. Everything's handled by the rendering engine; we're basically scripting. Testing out the various examples in the 3D folder was a real eye-opener; demystifying!Psychophanta wrote:...3D programming is not much to do with other programming.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Re: 3D challenge for a special rotation
Hello,
I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".
I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".
Re: 3D challenge for a special rotation
Which example are you trying to run? And does it work in the PureBasic IDE?ymerdy wrote:I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: 3D challenge for a special rotation
Must be the 'Engine3D.dll' file you find inside "C:\programfiles\PureBasic5.70\Compilers".ymerdy wrote:Hello,
I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".
'Engine3D.dll' 5.70 PB version.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: 3D challenge for a special rotation
Hello,
yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...
yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: 3D challenge for a special rotation
That is very strange, but sure there is something wrong, i can not help you, sorry.ymerdy wrote:Hello,
yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: 3D challenge for a special rotation
Needs x86 version, not x64.Psychophanta wrote:That is very strange, but sure there is something wrong, i can not help you, sorry.ymerdy wrote:Hello,
yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...
Re: 3D challenge for a special rotation
OK, with x86 version, it works
Thanx!
Thanx!
- NicTheQuick
- Addict
- Posts: 1226
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: 3D challenge for a special rotation
Why are they still people using the 32 bit versions? This is old stuff, use it only if there is no other way.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: 3D challenge for a special rotation
NicTheQuick wrote:Why are they still people using the 32 bit versions? This is old stuff, use it only if there is no other way.
Sorry, I work with linux 64bit and XP 32bit.
XP is much faster than 7, 8.1 and 10. I don't support a OS slower than myself.
That IS a true, so my OS is XP and linux, because i use computer to produce.
But you are right, most people use 64bit. So uploaded win64 bit in first post.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
- NicTheQuick
- Addict
- Posts: 1226
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: 3D challenge for a special rotation
If you are still using XP you've got much more problems than a slow machine. Kill it with fire, upgrade to Windows 7 or 10 or delete it completely to switch to Linux. But don't use operating systems with security holes and old encryption techniques in combination with internet. As a programmer you should know what that means. Hopefully...
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
- Psychophanta
- Addict
- Posts: 4996
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: 3D challenge for a special rotation
This is full off topic.NicTheQuick wrote:If you are still using XP you've got much more problems than a slow machine. Kill it with fire, upgrade to Windows 7 or 10 or delete it completely to switch to Linux. But don't use operating systems with security holes and old encryption techniques in combination with internet. As a programmer you should know what that means. Hopefully...
Well I use it since 2003, with no antivirus never, with no problems.
Windows 7, 8 and 10 are virus itselves, and a undefined amount of lacks , slowing , and problems.
The first thing i got very scared was this simple example:
In a spanish installation of 7, 8, 8.1, or 10, in C: (system partition) there is not appear a folder named "Program files", however system does not allow to create a folder named "Program files".
This fact is just a sympthom the entire system IS A VIRUS.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB